2 Polymer('paper-focusable', {
7 * If true, the button is currently active either because the
8 * user is holding down the button, or the button is a toggle
9 * and is currently in the active state.
15 active
: {value
: false, reflect
: true},
18 * If true, the element currently has focus due to keyboard
25 focused
: {value
: false, reflect
: true},
28 * If true, the user is currently holding down the button.
34 pressed
: {value
: false, reflect
: true},
37 * If true, the user cannot interact with this element.
43 disabled
: {value
: false, reflect
: true},
46 * If true, the button toggles the active state with each tap.
47 * Otherwise, the button becomes active when the user is holding
54 isToggle
: {value
: false, reflect
: false}
58 disabledChanged: function() {
60 this.removeAttribute('tabindex');
62 this.setAttribute('tabindex', 0);
66 downAction: function() {
71 this.active
= !this.active
;
77 // Pulling up the context menu for an item should focus it; but we need to
78 // be careful about how we deal with down/up events surrounding context
79 // menus. The up event typically does not fire until the context menu
80 // closes: so we focus immediately.
82 // This fires _after_ downAction.
83 contextMenuAction: function(e
) {
84 // Note that upAction may fire _again_ on the actual up event.
89 upAction: function() {
97 focusAction: function() {
99 // Only render the "focused" state if the element gains focus due to
100 // keyboard navigation.
105 blurAction: function() {
106 this.focused
= false;