Catrope has uploaded a new change for review.

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

Change subject: Revert "Revert "Show the modal overlay as soon as openWindow is 
called""
......................................................................

Revert "Revert "Show the modal overlay as soon as openWindow is called""

Reapplying ca6a16f613e186bec05a481e36dff5eb9f70e0e8.

This reverts commit 234cd9f9c51b0467d2933b5a78a65881f96215bc.

Change-Id: If3ea64421c2a85fcb57a967ae10514a1ad448570
---
M src/Window.js
M src/WindowManager.js
M src/styles/WindowManager.less
M src/themes/apex/windows.less
M src/themes/mediawiki/windows.less
5 files changed, 36 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/92/174892/1

diff --git a/src/Window.js b/src/Window.js
index 6c487f0..2c5796d 100644
--- a/src/Window.js
+++ b/src/Window.js
@@ -37,7 +37,6 @@
  * @param {Object} [config] Configuration options
  * @cfg {string} [size] Symbolic name of dialog size, `small`, `medium`, 
`large` or `full`; omit to
  *   use #static-size
- * @fires initialize
  */
 OO.ui.Window = function OoUiWindow( config ) {
        // Configuration initialization
@@ -419,7 +418,7 @@
  * instead of display.
  *
  * @param {boolean} [show] Make window visible, omit to toggle visibility
- * @fires visible
+ * @fires toggle
  * @chainable
  */
 OO.ui.Window.prototype.toggle = function ( show ) {
@@ -680,7 +679,7 @@
 
        this.getTeardownProcess( data ).execute().done( function () {
                // Force redraw by asking the browser to measure the elements' 
widths
-               win.$element.removeClass( 'oo-ui-window-setup' ).width();
+               win.$element.removeClass( 'oo-ui-window-load 
oo-ui-window-setup' ).width();
                win.$content.removeClass( 'oo-ui-window-content-setup' 
).width();
                win.$element.hide();
                win.visible = false;
@@ -693,10 +692,9 @@
 /**
  * Load the frame contents.
  *
- * Once the iframe's stylesheets are loaded, the `load` event will be emitted 
and the returned
- * promise will be resolved. Calling while loading will return a promise but 
not trigger a new
- * loading cycle. Calling after loading is complete will return a promise 
that's already been
- * resolved.
+ * Once the iframe's stylesheets are loaded the returned promise will be 
resolved. Calling while
+ * loading will return a promise but not trigger a new loading cycle. Calling 
after loading is
+ * complete will return a promise that's already been resolved.
  *
  * Sounds simple right? Read on...
  *
@@ -725,12 +723,13 @@
  * All this stylesheet injection and polling magic is in #transplantStyles.
  *
  * @return {jQuery.Promise} Promise resolved when loading is complete
- * @fires load
  */
 OO.ui.Window.prototype.load = function () {
        var sub, doc, loading,
                win = this;
 
+       this.$element.addClass( 'oo-ui-window-load' );
+
        // Non-isolated windows are already "loaded"
        if ( !this.loading && !this.isolated ) {
                this.loading = $.Deferred().resolve();
diff --git a/src/WindowManager.js b/src/WindowManager.js
index 2d655ea..387e372 100644
--- a/src/WindowManager.js
+++ b/src/WindowManager.js
@@ -391,13 +391,10 @@
 
        // Window opening
        if ( opening.state() !== 'rejected' ) {
-               // Begin loading the window if it's not loading or loaded 
already - may take noticable time
-               // and we want to do this in parallel with any other 
preparatory actions
-               if ( !win.isLoading() && !win.isLoaded() ) {
-                       // Finish initializing the window (must be done after 
manager is attached to DOM)
+               if ( !win.getManager() ) {
                        win.setManager( this );
-                       preparing.push( win.load() );
                }
+               preparing.push( win.load() );
 
                if ( this.closing ) {
                        // If a window is currently closing, wait for it to 
complete
diff --git a/src/styles/WindowManager.less b/src/styles/WindowManager.less
index 5a78c7f..1263689 100644
--- a/src/styles/WindowManager.less
+++ b/src/styles/WindowManager.less
@@ -7,7 +7,7 @@
                height: 0;
                overflow: hidden;
 
-               &.oo-ui-window-setup {
+               &.oo-ui-window-load {
                        width: auto;
                        height: auto;
                        top: 0;
@@ -15,22 +15,30 @@
                        bottom: 0;
                        left: 0;
                        padding: 1em;
+               }
 
-                       > .oo-ui-window-frame {
-                               position: absolute;
-                               right: 0;
-                               left: 0;
-                               margin: auto;
-                               overflow: hidden;
-                               max-width: 100%;
-                               max-height: 100%;
+               &.oo-ui-window-setup > .oo-ui-window-frame {
+                       position: absolute;
+                       right: 0;
+                       left: 0;
+                       margin: auto;
+                       overflow: hidden;
+                       max-width: 100%;
+                       max-height: 100%;
 
-                               > iframe {
-                                       width: 100%;
-                                       height: 100%;
-                               }
+                       > iframe {
+                               width: 100%;
+                               height: 100%;
                        }
                }
+
+               .oo-ui-window-frame {
+                       visibility: hidden;
+               }
+
+               &.oo-ui-window-ready > .oo-ui-window-frame {
+                       visibility: visible;
+               }
        }
 
        &-fullscreen > .oo-ui-dialog > .oo-ui-window-frame {
diff --git a/src/themes/apex/windows.less b/src/themes/apex/windows.less
index a8edbfa..4dab86f 100644
--- a/src/themes/apex/windows.less
+++ b/src/themes/apex/windows.less
@@ -317,9 +317,11 @@
                        .oo-ui-transition(all 250ms ease-in-out);
                }
 
-               &.oo-ui-window-ready {
+               &.oo-ui-window-load {
                        opacity: 1;
+               }
 
+               &.oo-ui-window-ready {
                        > .oo-ui-window-frame  {
                                .oo-ui-transform(scale(1));
                        }
diff --git a/src/themes/mediawiki/windows.less 
b/src/themes/mediawiki/windows.less
index 84b7dff..f45216e 100644
--- a/src/themes/mediawiki/windows.less
+++ b/src/themes/mediawiki/windows.less
@@ -310,9 +310,11 @@
                        .oo-ui-transition(all 250ms ease-in-out);
                }
 
-               &.oo-ui-window-ready {
+               &.oo-ui-window-load {
                        opacity: 1;
+               }
 
+               &.oo-ui-window-ready {
                        > .oo-ui-window-frame  {
                                .oo-ui-transform(scale(1));
                        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3ea64421c2a85fcb57a967ae10514a1ad448570
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Catrope <roan.katt...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to