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
bd33bf40
Unverified
Commit
bd33bf40
authored
Sep 20, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Creating & using a dynamic view component. Component is set depending on laravel config
parent
4c4fc7d0
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53405 additions
and
35361 deletions
+53405
-35361
ActiveEditor.js
Modules/Core/Assets/js/mixins/ActiveEditor.js
+14
-0
PageForm.vue
Modules/Page/Assets/js/components/PageForm.vue
+5
-3
app.js
public/js/app.js
+53386
-35358
No files found.
Modules/Core/Assets/js/mixins/ActiveEditor.js
0 → 100644
View file @
bd33bf40
export
default
{
methods
:
{
getCurrentEditor
()
{
const
configuredEditor
=
window
.
AsgardCMS
.
editor
;
if
(
configuredEditor
===
'
simplemde
'
)
{
return
'
markdown-editor
'
;
}
if
(
configuredEditor
===
'
ckeditor
'
)
{
return
'
ckeditor
'
;
}
return
'
ckeditor
'
},
}
}
Modules/Page/Assets/js/components/PageForm.vue
View file @
bd33bf40
...
...
@@ -45,8 +45,9 @@
<
el
-
form
-
item
:
label
=
"
trans('page.body')
"
:
class
=
"
{'el-form-item is-error': form.errors.has(locale + '.body')
}
"
>
<
ckeditor
v
-
model
=
"
page[locale].body
"
:
value
=
"
page[locale].body
"
>
<
/ckeditor
>
<
component
:
is
=
"
getCurrentEditor()
"
v
-
model
=
"
page[locale].body
"
:
value
=
"
page[locale].body
"
>
<
/component
>
<
div
class
=
"
el-form-item__error
"
v
-
if
=
"
form.errors.has(locale + '.body')
"
v
-
text
=
"
form.errors.first(locale + '.body')
"
><
/div
>
<
/el-form-item
>
...
...
@@ -154,10 +155,11 @@
import
axios
from
'
axios
'
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
Form
from
'
form-backend-validation
'
export
default
{
mixins
:
[
Slugify
,
ShortcutHelper
],
mixins
:
[
Slugify
,
ShortcutHelper
,
ActiveEditor
],
props
:
{
locales
:
{
default
:
null
}
,
pageTitle
:
{
default
:
null
,
String
}
,
...
...
public/js/app.js
View file @
bd33bf40
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