Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/205592
Change subject: ButtonWidget: Remove pointless #isHyperlink property
......................................................................
ButtonWidget: Remove pointless #isHyperlink property
One can just check #href. This was private and undocumented.
Change-Id: Ie0621a0fbf3b33f553e7d13403841fbe163ab11d
---
M src/widgets/ButtonWidget.js
1 file changed, 2 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/92/205592/1
diff --git a/src/widgets/ButtonWidget.js b/src/widgets/ButtonWidget.js
index f909dd4..db04b5d 100644
--- a/src/widgets/ButtonWidget.js
+++ b/src/widgets/ButtonWidget.js
@@ -54,7 +54,6 @@
this.href = null;
this.target = null;
this.noFollow = false;
- this.isHyperlink = false;
// Initialization
this.$button.append( this.$icon, this.$label, this.$indicator );
@@ -108,7 +107,7 @@
*/
OO.ui.ButtonWidget.prototype.onClick = function ( e ) {
var ret = OO.ui.ButtonElement.prototype.onClick.call( this, e );
- if ( this.isHyperlink ) {
+ if ( this.href ) {
return true;
}
return ret;
@@ -119,7 +118,7 @@
*/
OO.ui.ButtonWidget.prototype.onKeyPress = function ( e ) {
var ret = OO.ui.ButtonElement.prototype.onKeyPress.call( this, e );
- if ( this.isHyperlink ) {
+ if ( this.href ) {
return true;
}
return ret;
@@ -164,10 +163,8 @@
this.href = href;
if ( href !== null ) {
this.$button.attr( 'href', href );
- this.isHyperlink = true;
} else {
this.$button.removeAttr( 'href' );
- this.isHyperlink = false;
}
}
--
To view, visit https://gerrit.wikimedia.org/r/205592
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0621a0fbf3b33f553e7d13403841fbe163ab11d
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits