Jdlrobson has uploaded a new change for review.

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

Change subject: Fix visual feedback for creating a new collection
......................................................................

Fix visual feedback for creating a new collection

Add abstraction methods
Bug: T92034

Change-Id: I3e0c54127f53f01c8a5e2b6c415e0a1af25a7939
---
M resources/ext.gather.watchstar/CollectionsContentOverlay.js
1 file changed, 17 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather 
refs/changes/25/195625/1

diff --git a/resources/ext.gather.watchstar/CollectionsContentOverlay.js 
b/resources/ext.gather.watchstar/CollectionsContentOverlay.js
index 9b520e4..e9471b3 100644
--- a/resources/ext.gather.watchstar/CollectionsContentOverlay.js
+++ b/resources/ext.gather.watchstar/CollectionsContentOverlay.js
@@ -57,7 +57,21 @@
                },
                /** @inheritdoc */
                postRender: function () {
+                       this.hideSpinner();
+               },
+               /**
+                * Reveal all interface elements and cancel the spinner.
+                */
+               hideSpinner: function () {
+                       this.$( '.overlay-content' ).children().show();
                        this.$( '.spinner' ).hide();
+               },
+               /**
+                * Hide all interface elements and show spinner.
+                */
+               showSpinner: function () {
+                       this.$( '.overlay-content' ).children().hide();
+                       this.$( '.spinner' ).show();
                },
                /**
                 * Event handler for setting up a new collection
@@ -68,6 +82,7 @@
                                title = $( ev.target ).find( 'input' ).val();
 
                        ev.preventDefault();
+                       this.showSpinner();
                        this.addCollection( title, page );
                },
                /**
@@ -91,7 +106,7 @@
                                id:  $target.data( 'collection-id' ),
                                isWatchlist: $target.data( 
'collection-is-watchlist' )
                        };
-                       this.$( '.spinner' ).show();
+                       this.showSpinner();
                        if ( $target.data( 'collection-is-member' ) ) {
                                this.removeFromCollection( collection, page );
                        } else {
@@ -123,7 +138,7 @@
                        // refresh the ui
                        this.render();
                        // update UI
-                       this.$( '.spinner' ).hide();
+                       this.hideSpinner();
                        this.hide();
 
                        if ( currentPageIsMember ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e0c54127f53f01c8a5e2b6c415e0a1af25a7939
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

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

Reply via email to