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 () {
var start = function () {
require(['overrides', 'jquery', 'jqm', 'jquery.json', 'renderjs'],
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(
function () {
console.log("bindReady called, trigger create");
$("[data-gadget]").trigger('create');
$("[data-gadget]").filter(
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