Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: Prevent category selector tipsies from hanging around forever
......................................................................

Prevent category selector tipsies from hanging around forever

Bug: T115636
Change-Id: Ibcc0838e50f35c516a9d134fc5ce8cc2fe9ca42a
---
M resources/mw.UploadWizardDetails.js
1 file changed, 13 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/15/247915/1

diff --git a/resources/mw.UploadWizardDetails.js 
b/resources/mw.UploadWizardDetails.js
index 0f87c7b..ce4dc7d 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -444,6 +444,15 @@
                };
                this.categoriesWidget.setItemsFromData( categories );
 
+               this.categoriesWidgetItems = this.categoriesWidget.getItems();
+               this.categoriesWidget.on( 'change', function () {
+                       // Kill any active tipsies, they like to get stuck
+                       for ( var i = 0; i < this.categoriesWidgetItems.length; 
i++ ) {
+                               this.categoriesWidgetItems[ i ].$element.tipsy( 
'hide' );
+                       }
+                       this.categoriesWidgetItems = 
this.categoriesWidget.getItems();
+               }.bind( this ) );
+
                $categoriesDiv.find( '.mwe-upwiz-details-input' )
                        .append( this.categoriesWidget.$element );
        };
@@ -853,6 +862,10 @@
                // side effect: add error text to the page for fields in an 
incorrect state.
                // we must call EVERY valid() function due to side effects; do 
not short-circuit.
                valid: function () {
+                       // Kill any active tipsies, they like to get stuck
+                       for ( var i = 0; i < this.categoriesWidgetItems.length; 
i++ ) {
+                               this.categoriesWidgetItems[ i ].$element.tipsy( 
'hide' );
+                       }
                        // all the descriptions -- check min & max length
                        // categories are assumed valid
                        // pop open the 'more-options' if the date is bad

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibcc0838e50f35c516a9d134fc5ce8cc2fe9ca42a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

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

Reply via email to