ConnectionButton.js (857B)
1 /** 2 * Implements a simple connection button which can cycle between disconnected and connected state. 3 */ 4 Ext.define('PartKeepr.ConnectionButton', { 5 extend: 'Ext.Button', 6 7 /** 8 * The icon class to use when the button is in "connected" state 9 * @var string 10 */ 11 connectedIconCls: 'web-icon connect', 12 13 /** 14 * The icon class to use when the button is in "disconnected" state 15 * @var string 16 */ 17 disconnectedIconCls: 'web-icon disconnect', 18 19 cls: 'x-btn-icon', 20 iconCls: 'web-icon disconnect', 21 tooltip: i18n("Disconnected"), 22 23 setConnected: function () 24 { 25 this.setIconCls(this.connectedIconCls); 26 this.setTooltip(i18n("Connected")); 27 }, 28 setDisconnected: function () 29 { 30 this.setIconCls(this.disconnectedIconCls); 31 this.setTooltip(i18n("Disconnected")); 32 } 33 });