Bartosz Dziewoński has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/337599 )
Change subject: Do not clear unrelated flags when clearing 'progressive'
......................................................................
Do not clear unrelated flags when clearing 'progressive'
This would cause any custom flags added by users of the library
to disappear.
Change-Id: I8df87c651e410692effc4656dc8280f998e3dd87
---
M src/Tool.js
M src/widgets/OutlineOptionWidget.js
2 files changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/99/337599/1
diff --git a/src/Tool.js b/src/Tool.js
index af3a9db..b349f3a 100644
--- a/src/Tool.js
+++ b/src/Tool.js
@@ -247,10 +247,10 @@
this.active = !!state;
if ( this.active ) {
this.$element.addClass( 'oo-ui-tool-active' );
- this.setFlags( 'progressive' );
+ this.setFlags( { progressive: true } );
} else {
this.$element.removeClass( 'oo-ui-tool-active' );
- this.clearFlags();
+ this.setFlags( { progressive: false } );
}
};
diff --git a/src/widgets/OutlineOptionWidget.js
b/src/widgets/OutlineOptionWidget.js
index 4ae9e3c..2d24fcd 100644
--- a/src/widgets/OutlineOptionWidget.js
+++ b/src/widgets/OutlineOptionWidget.js
@@ -101,9 +101,9 @@
OO.ui.OutlineOptionWidget.prototype.setPressed = function ( state ) {
OO.ui.OutlineOptionWidget.parent.prototype.setPressed.call( this, state
);
if ( this.pressed ) {
- this.setFlags( 'progressive' );
+ this.setFlags( { progressive: true } );
} else if ( !this.selected ) {
- this.clearFlags();
+ this.setFlags( { progressive: false } );
}
return this;
};
@@ -142,9 +142,9 @@
OO.ui.OutlineOptionWidget.prototype.setSelected = function ( state ) {
OO.ui.OutlineOptionWidget.parent.prototype.setSelected.call( this,
state );
if ( this.selected ) {
- this.setFlags( 'progressive' );
+ this.setFlags( { progressive: true } );
} else {
- this.clearFlags();
+ this.setFlags( { progressive: false } );
}
return this;
};
--
To view, visit https://gerrit.wikimedia.org/r/337599
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8df87c651e410692effc4656dc8280f998e3dd87
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