Skip to content

Instantly share code, notes, and snippets.

@joelwatson
Created June 15, 2017 01:27
Show Gist options
  • Save joelwatson/2e5664ac6695de3e6259d3a26dac7a46 to your computer and use it in GitHub Desktop.
Save joelwatson/2e5664ac6695de3e6259d3a26dac7a46 to your computer and use it in GitHub Desktop.
CheckBoxMenuItem Future
ST.future.define('CheckBoxMenuItem', {
extend: ST.future.Component,
playables: {
checked: {
is: function () {
var cmp = this.getComponent();
return cmp.checked;
},
wait: ['checkchange']
},
unchecked: {
is: function () {
var cmp = this.getComponent();
return !cmp.checked;
},
wait: ['checkchange']
},
check: {
params: 'timeout',
fn: function () {
this.getComponent().setChecked(true);
}
},
uncheck: {
params: 'timeout',
fn: function () {
this.getComponent().setChecked(false);
}
}
}
});
ST.future.Component.prototype.gotoCheckBoxMenuItem = function (selector, direction, timeout) {
return this._goto('ST.future.CheckBoxMenuItem', direction, selector, timeout);
}
// test against http://examples.sencha.com/extjs/6.5.0/examples/kitchensink/?classic#toolbar-menus
ST.button('button[text="Button w/ Menu"]')
.expand()
.gotoCheckBoxMenuItem('[text="I like Ext"]')
.uncheck()
.unchecked()
.check()
.checked();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment