Skip to content

Instantly share code, notes, and snippets.

@wbamberg
Created February 4, 2014 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wbamberg/8798330 to your computer and use it in GitHub Desktop.
Save wbamberg/8798330 to your computer and use it in GitHub Desktop.
var { ToggleButton } = require("sdk/ui/button/toggle");
var toggle = ToggleButton({
id: "my-button",
label: "my button",
icon: {
"16": "./firefox-16.png",
"32": "./firefox-32.png"
}
});
var { ActionButton } = require("sdk/ui/button/action");
var button = ActionButton({
id: "my-button",
label: "my button",
icon: {
"16": "./favicon.ico"
},
onClick: function() {
if (toggle.disabled) {
toggle.disabled = false;
}
else {
toggle.disabled = true;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment