GUI -- Fixed topo toolbar button synchronization with keystroke commands.
- Added toggleNoCb to the toggle button widget.
- Added _keyListener property to keyBindings structure, and the invocation of it from keyIn().
- Added keyListener to topoToolbar to synchronize button state.
Change-Id: Iffb1dc5d38f2d9010f5e246cfb81a6b3db30d4af
diff --git a/web/gui/src/main/webapp/app/fw/widget/button.js b/web/gui/src/main/webapp/app/fw/widget/button.js
index 6b4ca28..c9980ee 100644
--- a/web/gui/src/main/webapp/app/fw/widget/button.js
+++ b/web/gui/src/main/webapp/app/fw/widget/button.js
@@ -92,10 +92,15 @@
is.loadIcon(togDiv, gid, btnSize, true);
togDiv.classed('selected', sel);
- function _toggle(b) {
+ function _toggle(b, nocb) {
sel = (b === undefined) ? !sel : !!b;
togDiv.classed('selected', sel);
- cbFnc(sel);
+ nocb || cbFnc(sel);
+ }
+
+ // toggle the button state without invoking the callback
+ function toggleNoCb() {
+ _toggle(undefined, true);
}
togDiv.on('click', _toggle);
@@ -104,7 +109,8 @@
id: id,
width: buttonWidth,
selected: function () { return sel; },
- toggle: _toggle
+ toggle: _toggle,
+ toggleNoCb: toggleNoCb
}
}