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

Commit 9f7bb63

Browse files
committed
Merge pull request #240 from patrinhani-ciandt/patrinhani-contrib-239
#239: The "elementsContainer" option on medium-editor is not been con…
2 parents a108c76 + 530b633 commit 9f7bb63

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/js/embeds.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,10 @@
511511
return;
512512
}
513513

514-
$('body').append(this.templates['src/js/templates/embeds-toolbar.hbs']({
514+
var mediumEditor = this.core.getEditor();
515+
var toolbarContainer = mediumEditor.options.elementsContainer || 'body';
516+
517+
$(toolbarContainer).append(this.templates['src/js/templates/embeds-toolbar.hbs']({
515518
styles: this.options.styles,
516519
actions: this.options.actions
517520
}).trim());

src/js/images.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,10 @@
545545
active = false,
546546
$toolbar, $toolbar2, top;
547547

548-
$('body').append(this.templates['src/js/templates/images-toolbar.hbs']({
548+
var mediumEditor = this.core.getEditor();
549+
var toolbarContainer = mediumEditor.options.elementsContainer || 'body';
550+
551+
$(toolbarContainer).append(this.templates['src/js/templates/images-toolbar.hbs']({
549552
styles: this.options.styles,
550553
actions: this.options.actions
551554
}).trim());

0 commit comments

Comments
 (0)