Amire80 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/126974

Change subject: Render the dialog only after clicking the trigger
......................................................................

Render the dialog only after clicking the trigger

Rendering the dialog should only happen after clicking it
for the first time to avoid loading unnecessary modules
and DOM manipulation.

Change-Id: I7ab119a18d8c0433e5c3b21edfcc9c90c953d14f
---
M modules/entrypoint/ext.cx.entrypoint.js
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/74/126974/1

diff --git a/modules/entrypoint/ext.cx.entrypoint.js 
b/modules/entrypoint/ext.cx.entrypoint.js
index 3916bb2..8e876ed 100644
--- a/modules/entrypoint/ext.cx.entrypoint.js
+++ b/modules/entrypoint/ext.cx.entrypoint.js
@@ -62,7 +62,6 @@
         * Initialize the plugin.
         */
        CXEntryPoint.prototype.init = function () {
-               this.render();
                this.listen();
        };
 
@@ -87,6 +86,10 @@
 
                        // jquery.uls.data is needed for autonyms
                        mw.loader.using( 'jquery.uls.data', function () {
+                               if ( !entryPoint.$dialog ) {
+                                       entryPoint.render();
+                               }
+
                                entryPoint.toggle();
                        } );
                } );

-- 
To view, visit https://gerrit.wikimedia.org/r/126974
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ab119a18d8c0433e5c3b21edfcc9c90c953d14f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to