Comment 2 for bug 1225482

Revision history for this message
Daniel Beck (d-danielbeck) wrote :

Just attaching the FastButton to the body instead of each component might be difficult: the handler would have to compute the right target mode. Using FastButton for each list element might be much easier.

For the backbutton, using touch-even could be realized as follow:

==== old code ====
a.onclick = function (e) {
            if (self._pageStack.depth() > 1)
  self._pageStack.pop();
            e.preventDefault();
 }.bind(self);
    };

=== new code ===
new FastButton(a,function (e) {
            if (self._pageStack.depth() > 1)
  self._pageStack.pop();
            e.preventDefault();
 };
    });

(remark: bind(self) is not called anymore. It that behavior must be kept, the FastButton constructor should be extended with a "self" argument.)