jenkins-bot has submitted this change and it was merged.

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, 15 insertions(+), 0 deletions(-)

Approvals:
  Prtksxna: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/mw.UploadWizardDetails.js 
b/resources/mw.UploadWizardDetails.js
index 0f87c7b..3afc13a 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -444,6 +444,16 @@
                };
                this.categoriesWidget.setItemsFromData( categories );
 
+               this.categoriesWidgetItems = this.categoriesWidget.getItems();
+               this.categoriesWidget.on( 'change', function () {
+                       var i;
+                       // Kill any active tipsies, they like to get stuck
+                       for ( 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 +863,11 @@
                // 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 () {
+                       var i;
+                       // Kill any active tipsies, they like to get stuck
+                       for ( 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: merged
Gerrit-Change-Id: Ibcc0838e50f35c516a9d134fc5ce8cc2fe9ca42a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoƄski <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: Prtksxna <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to