Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Commit

Permalink
hideButtons is intern to the plugin
Browse files Browse the repository at this point in the history
`editorUpdatePlaceholder` will be called from inside MediumEditor, since we replace it to handle custom buttons.

This means every thing inside this function should be attached to MediumEditor.
Calling a method from medium-editor-insert-plugin (hideButtons) inside this method won't work.
That's why we need to re-inject it inside MediumEditor as `_hideInsertButtons`.

I cleaned up too much things in my previous PR ...
  • Loading branch information
j0k3r committed Jun 9, 2015
1 parent fb90ca4 commit bd0edea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
this.options.editor._serialize = this.options.editor.serialize;
this.options.editor._destroy = this.options.editor.destroy;
this.options.editor._setup = this.options.editor.setup;
this.options.editor._hideInsertButtons = this.hideButtons;

this.options.editor.serialize = this.editorSerialize;
this.options.editor.destroy = this.editorDestroy;
Expand Down Expand Up @@ -186,7 +187,7 @@

if (!(el.querySelector('img, blockquote')) && cloneHtml === '') {
this.showPlaceholder(el);
this.hideButtons();
this.base._hideInsertButtons($(el));
} else {
this.hidePlaceholder(el);
}
Expand Down

0 comments on commit bd0edea

Please sign in to comment.