Commit 11d56a4b authored by Sven Franck's avatar Sven Franck

jqm_3: fixed gadget rendering on subsequent pages

parent e66eda08
...@@ -8,24 +8,29 @@ define([], function () { ...@@ -8,24 +8,29 @@ define([], function () {
var start = function () { var start = function () {
require(['overrides', 'jquery', 'jqm', 'jquery.json', 'renderjs'], require(['overrides', 'jquery', 'jqm', 'jquery.json', 'renderjs'],
function () { function () {
console.log("done loading");
console.log( $ );
console.log( $.mobile );
console.log( $.mobile.autoInitializePage );
// START
if ($.mobile.autoInitializePage === false) {
// initialize JQM
$.mobile.initializePage();
console.log("init JQM");
// initialize renderJS
RenderJs.init();
// when all gadgets are loaded make sure JQM renders them $(document).on('pagebeforeshow','div:jqmData(role="page")', function () {
// renderJS handler
RenderJs.init();
RenderJs.bindReady( RenderJs.bindReady(
function () { function () {
console.log("bindReady called, trigger create"); $("[data-gadget]").filter(
$("[data-gadget]").trigger('create'); function() {
return $(this).jqmData("bound") !== true;
}
).each(
function () {
$(this).jqmData("bound",true).trigger('create');
}
)
}
);
}); });
// initialize JQM
if ($.mobile.autoInitializePage === false) {
$.mobile.initializePage();
} }
}); });
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment