Hi. I will try to explain a 'problem' that I have. My english is very
limited.
I do a simplified example with this little modification to mobile default
project (generated with create-application.py). Try this code in a default
mobile project, run, go to "Page 2" and press the hardware Back button from
a mobile device (or back button from navigator, not back button from
qooxdoo's NavigationPage).
This precarious modification is for catch the hardware Back button from a
mobile device.
Compiled with "source" this example works fine in Firefox and Chrome. But
compiled with "build" works fine only in Firefox. I mean, with Chrome and
build, the behavior is different than I expected.
My knownledge in javascript and qooxdoo is limited and I cant understand
this behavior change.
Anyone can give me some little help to understand what's happening. Thanks
this.cancelarback = false;
window.location.hash = "inicio";
this.hashChange = {widgets: {}, functions: []};
this.apilarHashChange = qx.lang.Function.bind(function(widget, fnc) {
if (this.hashChange.widgets[widget] == null) {
this.hashChange.widgets[widget] =
this.hashChange.functions.length;
this.hashChange.functions.push({widget: widget, fnc:
fnc});
}
}, this);
this.desapilarHashChange = qx.lang.Function.bind(function(widget) {
var index = this.hashChange.widgets[widget];
if (index != null) {
var item = this.hashChange.functions.pop();
this.hashChange.widgets[item.widget] = null;
item.fnc();
}
}, this);
window.addEventListener("hashchange", qx.lang.Function.bind(function(e){
if (this.cancelarback) {
this.cancelarback = false;
window.location.hash = "1";
if (this.hashChange.functions.length > 0) {
var item = this.hashChange.functions.pop();
this.hashChange.widgets[item.widget] = null;
item.fnc();
}
} else this.cancelarback = true;
}, this));
var page1 = new qx.ui.mobile.page.NavigationPage();
page1.setTitle("Page 1");
page1.addListener("initialize", function()
{
var button = new qx.ui.mobile.form.Button("Next Page");
page1.getContent().add(button);
button.addListener("tap", function() {
page2.show();
}, this);
},this);
var page2 = new qx.ui.mobile.page.NavigationPage();
page2.setTitle("Page 2");
page2.setShowBackButton(true);
page2.setBackButtonText("Back");
page2.addListener("initialize", function()
{
var label = new qx.ui.mobile.basic.Label("Content of Page 2");
page2.getContent().add(label);
},this);
page2.addListener("appear", function() {
this.apilarHashChange(page2, qx.lang.Function.bind(function(){
page1.show({reverse:true});
}, page2));
}, this);
page2.addListener("back", function() {
this.desapilarHashChange(this);
}, this);
// Add the pages to the page manager.
var manager = new qx.ui.mobile.page.Manager(false);
manager.addDetail([
page1,
page2
]);
// Page1 will be shown at start
page1.show();
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/question-about-a-mobile-project-behavior-tp7584484.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel