Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

configuring text of back button according to example no longer works #619

Closed
sunkencity opened this issue Dec 6, 2010 · 13 comments
Closed

Comments

@sunkencity
Copy link

$(document).bind("mobileinit", function(){
  $.mobile.page.prototype.options.backBtnText = "Tillbaka";
});

$.mobile.page is undefined at the time when mobileinit is called.

@ghost
Copy link

ghost commented Dec 8, 2010

The same goes for the keepNative value. The form docs recommend:


$(document).bind('mobileinit', function(){
    $.mobile.page.prototype.options.keepNative = "select, input.foo, textarea.bar";
});

An 'Uncaught TypeError: Cannot read property 'prototype' of undefined' error is thrown as $.mobile.page doesn't exist yet.

@garyns
Copy link

garyns commented Jan 12, 2011

I find that mobileinit never works. It works in the a2 release, not the current GIT code.

@toddparker
Copy link
Contributor

If this is a regression, we'll bump it to critical

@ryanttb
Copy link

ryanttb commented Jan 17, 2011

I'm with garyns, mobileinit doesn't seem be called for me when I link to http://jquerymobile.com/test/js/ (that's the daily build, correct?)

@johnbender
Copy link
Contributor

Todd,

This looks like an ordering issue in the manifest, but its hard to tell what's dependent on the core (which fires the mobile init) and therefore can't be executed before it. I'll take a look and see which widget extensions require things like gradeA etc and hopefully post back.

In the short term it appears ordering page before core solves this issue.

@toddparker
Copy link
Contributor

Thanks John.

@ryanttb
Copy link

ryanttb commented Jan 18, 2011

I accidentally had two jQueries included. I think the second one was unbinding my mobileinit.

@toddparker
Copy link
Contributor

So do you think this was just a syntax issue in your code and not in JQM? Should I close this and tell John B. that we're all set?

@ghost
Copy link

ghost commented Jan 18, 2011

Todd, I believe there is still an issue with the order things are defined, as I am seeing the mobileinit method firing every time but the certain options are not yet defined (like the keepNative option). Although I am a few commits behind and not running the head. I'll try the head when I can.

@sunkencity
Copy link
Author

From what I can gather as I try now, is that mobileinit is called when the widgets are undefined.

$(document).bind("mobileinit", function(){
  $.extend(  $.mobile , {loadingMessage: "Laddar"});
});

// This guy needs to be set after loading the jquerymobile js (then it works), 
// used to be able to put it in the mobileinit (I get $.mobile.page is undefined now)
$.mobile.page.prototype.options.backBtnText = "Tillbaka";

@toddparker
Copy link
Contributor

Thanks for the follow-up guys. John B. - looks like we still need you to look into the sequence of events here.

@johnbender
Copy link
Contributor

sunkencity,

You are correct, at this point I'm just double checking with the rest of the team for possible issues with my proposed correction.

@johnbender
Copy link
Contributor

moved page above core in the makefile, build xml, and manifest under js. Closed by b671753

fcheslack pushed a commit to fcheslack/jquery-mobile that referenced this issue Jul 28, 2011
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants