Set timeout to zero in media editor code
authorMatthias Schmidt <gravatronics@live.com>
Sun, 17 Jul 2016 10:49:24 +0000 (12:49 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 17 Jul 2016 10:49:29 +0000 (12:49 +0200)
wcfsetup/install/files/js/WoltLab/WCF/Media/Editor.js

index 04335cceaaa4a245594226f74145705ad4a09fe1..7f2fbab9e1b9e57e2a0598246758755495e6c16c 100644 (file)
@@ -239,6 +239,7 @@ define(
                                                        },
                                                        source: {
                                                                after: (function(content, data) {
+                                                                       // make sure that the language chooser is initialized first
                                                                        setTimeout(function() {
                                                                                LanguageChooser.setLanguageId('languageID', this._media.languageID || LANGUAGE_ID);
                                                                                
@@ -264,7 +265,7 @@ define(
                                                                                elById('mediaEditor_' + this._media.mediaID).parentNode.scrollTop = 0;
                                                                                
                                                                                DomChangeListener.trigger();
-                                                                       }.bind(this), 100);
+                                                                       }.bind(this), 0);
                                                                }).bind(this),
                                                                data: {
                                                                        actionName: 'getEditorDialog',