commit 460ca827e868648d1de4a3cbec79909d0b6b4062
parent 8bf5cb7404e238482070a4b42281a3e28573f795
Author: unitehenry <unitehenry@gmail.com>
Date: Fri, 25 Oct 2019 09:11:09 -0400
option element margins
Diffstat:
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/demo/src/App.vue b/demo/src/App.vue
@@ -7,9 +7,9 @@
ref="editor"
:toolbar-hide="toolbarHide"
:minimal="minimal"
- :toolbar-bottom="true"
+ :toolbar-bottom="false"
:placeholder="'Type something in here...'"
- style="min-height:300px; width: 800px;"
+ style="width: 800px;"
:meta-url="metaUrl"
:toolbar-template="customButton"
:on-enter="submitOnEnter"
@@ -31,7 +31,7 @@ export default {
return {
metaUrl: "https://mighty-anchorage-82390.herokuapp.com/meta", // metaserver.js
// imageUrl: "http://localhost:4200/image", // imageserver.js
- minimal: true,
+ minimal: false,
uploadOnPaste: false,
toolbarBottom: true,
toolbarHide: true,
diff --git a/src/striveneditor.css b/src/striveneditor.css
@@ -73,10 +73,13 @@
padding: 8px;
}
+.striven-editor .se-toolbar-group[data-open="true"] {
+ z-index: 1000;
+}
+
.striven-editor .se-toolbar-group[data-open="true"] .se-toolbar-option {
background-color: #fff;
border: 1px solid #ddd;
- margin: 0 2px;
}
.striven-editor .se-toolbar-group[data-open="true"] .se-toolbar-option:hover {
@@ -84,7 +87,7 @@
}
.striven-editor .se-toolbar-option > svg {
- transform: scale(1);
+ transform: scale(1); /* chrome bug fix */
vertical-align: middle;
}
diff --git a/src/striveneditor.js b/src/striveneditor.js
@@ -123,6 +123,9 @@ export default class StrivenEditor {
this.editor.classList.add("striven-editor");
+ // Stop events from bubbling up the DOM
+ this.editor.onkeypress = e => e.stopPropagation();
+
// Initialze with the value property in the options
this.setContent(this.options.value || '')