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

jqm_3: fixed gadget rendering on subsequent pages

parent e66eda08
......@@ -8,26 +8,31 @@ 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
$(document).on('pagebeforeshow','div:jqmData(role="page")', function () {
// renderJS handler
RenderJs.init();
// when all gadgets are loaded make sure JQM renders them
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();
}
});
};
return {"start": start};
});
});
\ No newline at end of file
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