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
47328f49
Unverified
Commit
47328f49
authored
Sep 27, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Creating a helper mixing to select single files
parent
f36d75c8
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
186 additions
and
131 deletions
+186
-131
SingleFileSelector.js
Modules/Media/Assets/js/mixins/SingleFileSelector.js
+9
-0
PageForm.vue
Modules/Page/Assets/js/components/PageForm.vue
+4
-7
app.js
public/js/app.js
+173
-124
No files found.
Modules/Media/Assets/js/mixins/SingleFileSelector.js
0 → 100644
View file @
47328f49
export
default
{
methods
:
{
selectSingleFile
(
event
,
model
)
{
this
[
model
].
medias_single
=
_
.
merge
(
this
[
model
].
medias_single
,
{
[
event
.
zone
]:
event
.
id
,
});
},
}
}
Modules/Page/Assets/js/components/PageForm.vue
View file @
47328f49
...
...
@@ -140,7 +140,7 @@
<
/el-form-item
>
<
tags
-
input
namespace
=
"
asgardcms/page
"
v
-
model
=
"
tags
"
:
value
=
"
tags
"
:
current
-
tags
=
"
tags
"
><
/tags-input
>
<
single
-
media
zone
=
"
image
"
@
singleFileSelected
=
"
selectSingleFile
"
<
single
-
media
zone
=
"
image
"
@
singleFileSelected
=
"
selectSingleFile
($event, 'page')
"
entity
=
"
Modules
\
Page
\
Entities
\
Page
"
:
entity
-
id
=
"
page.id
"
><
/single-media
>
<
/div
>
<
/div
>
...
...
@@ -156,10 +156,12 @@
import
Slugify
from
'
../../../../Core/Assets/js/mixins/Slugify
'
import
ShortcutHelper
from
'
../../../../Core/Assets/js/mixins/ShortcutHelper
'
import
ActiveEditor
from
'
../../../../Core/Assets/js/mixins/ActiveEditor
'
import
SingleFileSelector
from
'
../../../../Media/Assets/js/mixins/SingleFileSelector
'
import
Form
from
'
form-backend-validation
'
export
default
{
mixins
:
[
Slugify
,
ShortcutHelper
,
ActiveEditor
],
mixins
:
[
Slugify
,
ShortcutHelper
,
ActiveEditor
,
SingleFileSelector
],
props
:
{
locales
:
{
default
:
null
}
,
pageTitle
:
{
default
:
null
,
String
}
,
...
...
@@ -246,11 +248,6 @@
}
return
route
(
'
api.page.page.store
'
);
}
,
selectSingleFile
(
event
)
{
this
.
page
.
medias_single
=
{
[
event
.
zone
]:
event
.
id
,
}
;
}
}
,
mounted
()
{
this
.
fetchTemplates
();
...
...
public/js/app.js
View file @
47328f49
This diff is collapsed.
Click to expand it.
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