Fixed media integration failing for non-wysiwyg boxes
authorAlexander Ebert <ebert@woltlab.com>
Wed, 22 Feb 2017 12:13:44 +0000 (13:13 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 22 Feb 2017 12:13:44 +0000 (13:13 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Editor.js

index aa181dfe2b4d93b27d7e16b2bfe5ce10eb98bdcf..75806ad3a622a69f0c4f77674e0f4a82b3ae4d87 100644 (file)
@@ -22,7 +22,8 @@ define(['Core', 'Dictionary', 'Dom/Traverse', 'Language', 'Ui/Dialog', 'WoltLabS
                
                this._forceClipboard = true;
                this._activeButton = null;
-               this._buttons = elByClass(this._options.buttonClass || 'jsMediaEditorButton', this._options.editor.core.toolbar()[0]);
+               var context = (this._options.editor) ? this._options.editor.core.toolbar()[0] : undefined;
+               this._buttons = elByClass(this._options.buttonClass || 'jsMediaEditorButton', context);
                for (var i = 0, length = this._buttons.length; i < length; i++) {
                        this._buttons[i].addEventListener(WCF_CLICK_EVENT, this._click.bind(this));
                }