jenkins-bot has submitted this change and it was merged.
Change subject: Remove the 'flash' feature from MenuSelectWidget and
OptionWidget
......................................................................
Remove the 'flash' feature from MenuSelectWidget and OptionWidget
Inspired by Mac OS X's menus, it would flash the colors of the clicked
menu option, but…
* …it didn't really work, as the 'pressed' state is currently broken,
and no one noticed.
* …we only did it for the dropdown select menus and not the toolbar
menus.
* …it causes a lot of pain for other code hiding/showing menus. We'd
need a lot more bookkeeping to do this well.
Change-Id: If28239862eec997f98073f98ba9aa43de1c227d9
---
M src/widgets/MenuSelectWidget.js
M src/widgets/OptionWidget.js
2 files changed, 2 insertions(+), 46 deletions(-)
Approvals:
Krinkle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/src/widgets/MenuSelectWidget.js b/src/widgets/MenuSelectWidget.js
index 6d8ab6d..cfd1c92 100644
--- a/src/widgets/MenuSelectWidget.js
+++ b/src/widgets/MenuSelectWidget.js
@@ -27,7 +27,6 @@
OO.ui.ClippableElement.call( this, $.extend( {}, config, { $clippable:
this.$group } ) );
// Properties
- this.flashing = false;
this.visible = false;
this.newItems = null;
this.autoHide = config.autoHide === undefined || !!config.autoHide;
@@ -141,27 +140,14 @@
/**
* Choose an item.
*
- * This will close the menu when done, unlike selectItem which only changes
selection.
+ * This will close the menu, unlike #selectItem which only changes selection.
*
* @param {OO.ui.OptionWidget} item Item to choose
* @chainable
*/
OO.ui.MenuSelectWidget.prototype.chooseItem = function ( item ) {
- var widget = this;
-
- // Parent method
OO.ui.MenuSelectWidget.super.prototype.chooseItem.call( this, item );
-
- if ( item && !this.flashing ) {
- this.flashing = true;
- item.flash().done( function () {
- widget.toggle( false );
- widget.flashing = false;
- } );
- } else {
- this.toggle( false );
- }
-
+ this.toggle( false );
return this;
};
diff --git a/src/widgets/OptionWidget.js b/src/widgets/OptionWidget.js
index 8314b32..9f08fd0 100644
--- a/src/widgets/OptionWidget.js
+++ b/src/widgets/OptionWidget.js
@@ -154,33 +154,3 @@
}
return this;
};
-
-/**
- * Make the option's highlight flash.
- *
- * While flashing, the visual style of the pressed state is removed if present.
- *
- * @return {jQuery.Promise} Promise resolved when flashing is done
- */
-OO.ui.OptionWidget.prototype.flash = function () {
- var widget = this,
- $element = this.$element,
- deferred = $.Deferred();
-
- if ( !this.isDisabled() && this.constructor.static.pressable ) {
- $element.removeClass( 'oo-ui-optionWidget-highlighted
oo-ui-optionWidget-pressed' );
- setTimeout( function () {
- // Restore original classes
- $element
- .toggleClass( 'oo-ui-optionWidget-highlighted',
widget.highlighted )
- .toggleClass( 'oo-ui-optionWidget-pressed',
widget.pressed );
-
- setTimeout( function () {
- deferred.resolve();
- }, 100 );
-
- }, 100 );
- }
-
- return deferred.promise();
-};
--
To view, visit https://gerrit.wikimedia.org/r/186537
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If28239862eec997f98073f98ba9aa43de1c227d9
Gerrit-PatchSet: 3
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Prtksxna <[email protected]>
Gerrit-Reviewer: Trevor Parscal <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits