Jhernandez has uploaded a new change for review.
https://gerrit.wikimedia.org/r/205836
Change subject: When deleting collection hide dialog when actually finished
......................................................................
When deleting collection hide dialog when actually finished
Don't hide spinner and show toast until we are actually done.
Hide DeleteOverlay when the toast is shown and the page redirected.
Bug: T96294
Change-Id: I1264feb441e3d99fca98e8e5dce2af9484b06895
---
M resources/ext.gather.collection.delete/CollectionDeleteOverlay.js
M resources/ext.gather.collection.editor/CollectionEditOverlay.js
2 files changed, 7 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather
refs/changes/36/205836/1
diff --git a/resources/ext.gather.collection.delete/CollectionDeleteOverlay.js
b/resources/ext.gather.collection.delete/CollectionDeleteOverlay.js
index 95f5703..d13be52 100644
--- a/resources/ext.gather.collection.delete/CollectionDeleteOverlay.js
+++ b/resources/ext.gather.collection.delete/CollectionDeleteOverlay.js
@@ -41,17 +41,16 @@
// disable button and inputs
this.$( '.confirm, .cancel' ).prop( 'disabled', true );
this.api.removeCollection( this.id ).done( function () {
- // Show toast
- self.$( '.spinner' ).hide();
- toast.show( self.options.deleteSuccessMsg,
'toast' );
-
schema.log( {
eventName: 'delete-collection'
} ).always( function () {
+ // Show toast
+ self.$( '.spinner' ).hide();
+ toast.show(
self.options.deleteSuccessMsg, 'toast' );
+ self.hide();
// Go to the collections list page as
collection will no longer exist
window.location.href = mw.util.getUrl(
'Special:Gather' );
} );
-
} ).fail( function ( errMsg ) {
toast.show( self.options.deleteFailedError,
'toast error' );
self.hide();
diff --git a/resources/ext.gather.collection.editor/CollectionEditOverlay.js
b/resources/ext.gather.collection.editor/CollectionEditOverlay.js
index ac169ef..89e9fa4 100644
--- a/resources/ext.gather.collection.editor/CollectionEditOverlay.js
+++ b/resources/ext.gather.collection.editor/CollectionEditOverlay.js
@@ -179,9 +179,10 @@
* Event handler when the delete button is clicked.
*/
onDeleteActionClick: function () {
- this.$el.append( new CollectionDeleteOverlay( {
+ var deleteOverlay = new CollectionDeleteOverlay( {
collection: this.options.collection
- } ).$el );
+ } );
+ this.$el.append( deleteOverlay.$el );
},
/**
* Event handler when the back button is clicked on the
title/edit description pane.
--
To view, visit https://gerrit.wikimedia.org/r/205836
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1264feb441e3d99fca98e8e5dce2af9484b06895
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jhernandez <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits