Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
09114524
Commit
09114524
authored
Jun 21, 2020
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: live preview of custom css in editor
parent
4855051d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
editor.vue
client/components/editor.vue
+17
-0
No files found.
client/components/editor.vue
View file @
09114524
...
...
@@ -179,6 +179,7 @@ export default {
welcomeMode
()
{
return
this
.
mode
===
`create`
&&
this
.
path
===
`home`
},
currentPageTitle
:
sync
(
'page/title'
),
checkoutDateActive
:
sync
(
'editor/checkoutDateActive'
),
currentStyling
:
get
(
'page/scriptCss'
),
isDirty
()
{
return
_
.
some
([
this
.
initContentParsed
!==
this
.
$store
.
get
(
'editor/content'
),
...
...
@@ -198,6 +199,9 @@ export default {
this
.
dialogProps
=
true
},
500
)
}
},
currentStyling
(
newValue
)
{
this
.
injectCustomCss
(
newValue
)
}
},
created
()
{
...
...
@@ -524,7 +528,20 @@ export default {
tags
:
this
.
$store
.
get
(
'page/tags'
),
title
:
this
.
$store
.
get
(
'page/title'
)
}
},
injectCustomCss
:
_
.
debounce
(
css
=>
{
const
oldStyl
=
document
.
querySelector
(
'#editor-script-css'
)
if
(
oldStyl
)
{
document
.
head
.
removeChild
(
oldStyl
)
}
if
(
!
_
.
isEmpty
(
css
))
{
const
styl
=
document
.
createElement
(
'style'
)
styl
.
type
=
'text/css'
styl
.
id
=
'editor-script-css'
document
.
head
.
appendChild
(
styl
)
styl
.
appendChild
(
document
.
createTextNode
(
css
))
}
},
1000
)
},
apollo
:
{
isConflict
:
{
...
...
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