Skip to content

Commit

Permalink
remove .ql-embed-selected
Browse files Browse the repository at this point in the history
closes #1691
  • Loading branch information
jhchen committed Sep 11, 2017
1 parent 2c23266 commit 6528f2a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
4 changes: 0 additions & 4 deletions assets/core.styl
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,6 @@ resets(arr)
.ql-align-right
text-align: right

.ql-embed-selected
border: 2px solid #777
user-select: none

.ql-editor.ql-blank::before
color: rgba(0,0,0,0.6)
content: attr(data-placeholder)
Expand Down
18 changes: 0 additions & 18 deletions core/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class Selection {
this.lastRange = this.savedRange = new Range(0, 0);
this.handleComposition();
this.handleDragging();
this.handleEmbedSelection();
this.emitter.listenDOM('selectionchange', document, () => {
if (!this.mouseDown) {
setTimeout(this.update.bind(this, Emitter.sources.USER), 1);
Expand Down Expand Up @@ -85,23 +84,6 @@ class Selection {
});
}

handleEmbedSelection() {
this.emitter.on(Emitter.events.SELECTION_CHANGE, () => {
const selectedNode = document.querySelector('.ql-embed-selected');
if (selectedNode) {
selectedNode.classList.remove('ql-embed-selected');
}
});
this.root.addEventListener('click', (e) => {
const blot = Parchment.find(e.target, true);
if (blot instanceof Parchment.Embed) {
const range = new Range(blot.offset(scroll), blot.length());
this.setRange(range, Emitter.sources.USER);
blot.domNode.classList.add('ql-embed-selected');
}
});
}

focus() {
if (this.hasFocus()) return;
this.root.focus();
Expand Down

0 comments on commit 6528f2a

Please sign in to comment.