Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
aa431289
Commit
aa431289
authored
Jul 16, 2020
by
derek-knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Uneditable block spacing and minor listener refactor
parent
f724bf57
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
15 deletions
+18
-15
app/assets/javascripts/vue_shared/components/rich_content_editor/rich_content_editor.vue
...ed/components/rich_content_editor/rich_content_editor.vue
+16
-13
app/assets/javascripts/vue_shared/components/rich_content_editor/services/renderers/build_uneditable_token.js
...ntent_editor/services/renderers/build_uneditable_token.js
+1
-1
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/mock_data.js
...nents/rich_content_editor/services/renderers/mock_data.js
+1
-1
No files found.
app/assets/javascripts/vue_shared/components/rich_content_editor/rich_content_editor.vue
View file @
aa431289
...
...
@@ -73,15 +73,23 @@ export default {
},
},
beforeDestroy
()
{
removeCustomEventListener
(
this
.
editorApi
,
CUSTOM_EVENTS
.
openAddImageModal
,
this
.
onOpenAddImageModal
,
);
this
.
editorApi
.
eventManager
.
removeEventHandler
(
'
changeMode
'
,
this
.
onChangeMode
);
this
.
removeListeners
();
},
methods
:
{
addListeners
(
editorApi
)
{
addCustomEventListener
(
editorApi
,
CUSTOM_EVENTS
.
openAddImageModal
,
this
.
onOpenAddImageModal
);
editorApi
.
eventManager
.
listen
(
'
changeMode
'
,
this
.
onChangeMode
);
},
removeListeners
()
{
removeCustomEventListener
(
this
.
editorApi
,
CUSTOM_EVENTS
.
openAddImageModal
,
this
.
onOpenAddImageModal
,
);
this
.
editorApi
.
eventManager
.
removeEventHandler
(
'
changeMode
'
,
this
.
onChangeMode
);
},
resetInitialValue
(
newVal
)
{
this
.
editorInstance
.
invoke
(
'
setMarkdown
'
,
newVal
);
},
...
...
@@ -92,13 +100,8 @@ export default {
this
.
editorApi
=
editorApi
;
registerHTMLToMarkdownRenderer
(
editorApi
);
addCustomEventListener
(
this
.
editorApi
,
CUSTOM_EVENTS
.
openAddImageModal
,
this
.
onOpenAddImageModal
,
);
this
.
editorApi
.
eventManager
.
listen
(
'
changeMode
'
,
this
.
onChangeMode
);
this
.
addListeners
(
editorApi
);
},
onOpenAddImageModal
()
{
this
.
$refs
.
addImageModal
.
show
();
...
...
app/assets/javascripts/vue_shared/components/rich_content_editor/services/renderers/build_uneditable_token.js
View file @
aa431289
...
...
@@ -13,7 +13,7 @@ const buildUneditableOpenToken = (tagType = TAG_TYPES.block) =>
buildToken
(
'
openTag
'
,
tagType
,
{
attributes
:
{
contenteditable
:
false
},
classNames
:
[
'
gl-px-4 gl-py-2 gl-opacity-5 gl-bg-gray-100 gl-user-select-none gl-cursor-not-allowed
'
,
'
gl-px-4 gl-py-2 gl-
my-5 gl-
opacity-5 gl-bg-gray-100 gl-user-select-none gl-cursor-not-allowed
'
,
],
});
...
...
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/mock_data.js
View file @
aa431289
...
...
@@ -18,7 +18,7 @@ const buildMockUneditableOpenToken = type => {
tagName
:
type
,
attributes
:
{
contenteditable
:
false
},
classNames
:
[
'
gl-px-4 gl-py-2 gl-opacity-5 gl-bg-gray-100 gl-user-select-none gl-cursor-not-allowed
'
,
'
gl-px-4 gl-py-2 gl-
my-5 gl-
opacity-5 gl-bg-gray-100 gl-user-select-none gl-cursor-not-allowed
'
,
],
};
};
...
...
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