ubuntu-webapps-bugs team mailing list archive
-
ubuntu-webapps-bugs team
-
Mailing list archive
-
Message #00355
[Bug 1222874] Re: Confusing event-handling behavior of buttons when used in a toolbar
** Changed in: ubuntu-html5-theme
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Ubuntu
WebApps bug tracking, which is subscribed to ubuntu-html5-theme in
Ubuntu.
https://bugs.launchpad.net/bugs/1222874
Title:
Confusing event-handling behavior of buttons when used in a toolbar
Status in Ubuntu UI SDK for HTML5 Apps:
Fix Released
Status in “ubuntu-html5-theme” package in Ubuntu:
Fix Released
Bug description:
The current event-handling approach for buttons and the toolbar is as
followed:
- "button" has a click() method which registers a callback method for
a "click" event on a button.
- "toolbar" has a touch() method which registers a callback method for
a "mouseup" or a "touchend"-event on the toolbar.
However, this leads to problems then button are used in the toolbar.
The following code does not work as intended:
UI.toolbar("mytoolbar).touch(function (e){
UI.toolbar("mytoolbar).toggle(); // as recommanded by the Ubuntu Guidelines
}
UI.button("save").click(function(e){
saveSomeData();
e.stopImmediatePropagation() ; // prevents the event propagation to the containing toolbar
})
Since the "touch()" method registers for the "mouseup"/ "touchend"
event, which happens before the "click" event, this code first toggles
the toolbar, and then calls the callback method from the button.
"toolbar.prototype.touch(callback)" and
"button.prototype.click(callback)" should register for the same DOM
event type, i.e. eiter "mouseup"/"touchend" or "click". Also, this
would allow button.prototype.click() to prevent the event propagation
to the toolbar, by calling "stopPropagation()".
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-html5-theme/+bug/1222874/+subscriptions