Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
623abfff
Unverified
Commit
623abfff
authored
Oct 03, 2018
by
Nicolas Widart
Committed by
GitHub
Oct 03, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #603 from mikemand/fix/use-kebab-case-event-names
Use kebab-case for events
parents
3f3d24f8
457125f1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
MultipleMedia.vue
Modules/Media/Assets/js/components/MultipleMedia.vue
+4
-4
SingleMedia.vue
Modules/Media/Assets/js/components/SingleMedia.vue
+4
-4
PageForm.vue
Modules/Page/Assets/js/components/PageForm.vue
+1
-1
No files found.
Modules/Media/Assets/js/components/MultipleMedia.vue
View file @
623abfff
...
...
@@ -72,7 +72,7 @@
},
unSelectMedia
(
id
)
{
this
.
selectedMedia
=
_
.
reject
(
this
.
selectedMedia
,
media
=>
media
.
id
===
id
);
this
.
$emit
(
'
file
U
nselected
'
,
{
id
,
zone
:
this
.
zone
});
this
.
$emit
(
'
file
-u
nselected
'
,
{
id
,
zone
:
this
.
zone
});
},
fetchMedia
()
{
axios
.
get
(
route
(
'
api.media.get-by-zone-and-entity
'
,
{
...
...
@@ -83,7 +83,7 @@
.
then
((
response
)
=>
{
this
.
selectedMedia
=
response
.
data
.
data
;
_
.
forEach
(
this
.
selectedMedia
,
(
file
)
=>
{
this
.
$emit
(
'
multiple
FileSelected
'
,
{
id
:
file
.
id
,
zone
:
this
.
zone
}
);
this
.
$emit
(
'
multiple
-file-selected
'
,
_
.
merge
(
file
,
{
zone
:
this
.
zone
})
);
});
});
},
...
...
@@ -95,13 +95,13 @@
if
(
this
.
entityId
)
{
this
.
fetchMedia
();
}
this
.
eventName
=
`file
WasS
elected
${
this
.
randomString
()}${
Math
.
floor
(
Math
.
random
()
*
999999
)}
`
;
this
.
eventName
=
`file
-was-s
elected
${
this
.
randomString
()}${
Math
.
floor
(
Math
.
random
()
*
999999
)}
`
;
this
.
$events
.
listen
(
this
.
eventName
,
(
mediaData
)
=>
{
if
(
_
.
find
(
this
.
selectedMedia
,
mediaData
)
===
undefined
)
{
if
(
!
this
.
selectedMedia
)
this
.
selectedMedia
=
[];
this
.
selectedMedia
.
push
(
mediaData
);
this
.
$emit
(
'
multiple
FileS
elected
'
,
_
.
merge
(
mediaData
,
{
zone
:
this
.
zone
}));
this
.
$emit
(
'
multiple
-file-s
elected
'
,
_
.
merge
(
mediaData
,
{
zone
:
this
.
zone
}));
}
});
},
...
...
Modules/Media/Assets/js/components/SingleMedia.vue
View file @
623abfff
...
...
@@ -73,7 +73,7 @@
},
unSelectMedia
()
{
this
.
selectedMedia
=
{};
this
.
$emit
(
'
single
FileSelected
'
,
_
.
merge
({
id
:
null
},
{
zone
:
this
.
zone
})
);
this
.
$emit
(
'
single
-file-selected
'
,
{
id
:
null
,
zone
:
this
.
zone
}
);
},
fetchMedia
()
{
axios
.
get
(
route
(
'
api.media.find-first-by-zone-and-entity
'
,
{
...
...
@@ -82,7 +82,7 @@
entity_id
:
this
.
entityId
,
}))
.
then
((
response
)
=>
{
this
.
$emit
(
'
single
FileS
elected
'
,
_
.
merge
(
response
.
data
.
data
,
{
zone
:
this
.
zone
}));
this
.
$emit
(
'
single
-file-s
elected
'
,
_
.
merge
(
response
.
data
.
data
,
{
zone
:
this
.
zone
}));
this
.
selectedMedia
=
response
.
data
.
data
;
});
},
...
...
@@ -94,12 +94,12 @@
if
(
this
.
entityId
)
{
this
.
fetchMedia
();
}
this
.
eventName
=
`file
WasS
elected
${
this
.
randomString
()}${
Math
.
floor
(
Math
.
random
()
*
999999
)}
`
;
this
.
eventName
=
`file
-was-s
elected
${
this
.
randomString
()}${
Math
.
floor
(
Math
.
random
()
*
999999
)}
`
;
this
.
$events
.
listen
(
this
.
eventName
,
(
mediaData
)
=>
{
this
.
dialogVisible
=
false
;
this
.
selectedMedia
=
mediaData
;
this
.
$emit
(
'
single
FileS
elected
'
,
_
.
merge
(
mediaData
,
{
zone
:
this
.
zone
}));
this
.
$emit
(
'
single
-file-s
elected
'
,
_
.
merge
(
mediaData
,
{
zone
:
this
.
zone
}));
});
},
};
...
...
Modules/Page/Assets/js/components/PageForm.vue
View file @
623abfff
...
...
@@ -147,7 +147,7 @@
<
/el-form-item
>
<
tags
-
input
namespace
=
"
asgardcms/page
"
v
-
model
=
"
tags
"
:
current
-
tags
=
"
tags
"
><
/tags-input
>
<
single
-
media
zone
=
"
image
"
@
single
FileS
elected
=
"
selectSingleFile($event, 'page')
"
<
single
-
media
zone
=
"
image
"
@
single
-
file
-
s
elected
=
"
selectSingleFile($event, 'page')
"
entity
=
"
Modules
\
Page
\
Entities
\
Page
"
:
entity
-
id
=
"
$route.params.pageId
"
><
/single-media
>
<
/div
>
<
/div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment