Commit 065435e8 authored by Sven Franck's avatar Sven Franck

Fix: prevent re-loading existing gadgets on first page

parent c3b633ec
......@@ -154,7 +154,7 @@ define([
RenderJs.bindReady(function () {
var gadget = RenderJs.GadgetIndex.getGadgetById(page.attr('id'));
if (gadget.isEnhanced() === false) {
page.trigger("create");
// page.trigger("create");
gadget.setEnhanced(true);
}
});
......@@ -264,6 +264,12 @@ define([
return;
}
// so now we do it here...
if (gadget.isEnhanced() === false) {
gadget.dom.parent().trigger("create");
gadget.setEnhanced(true);
}
gadget_props = gadget["state"];
gadget_cleaned_id = gadget_id.split("__").slice(-1)[0];
......
......@@ -115,13 +115,13 @@ var RenderJs = (function () {
// async
if (async) {
async(data, function(markup){
gadget.append(markup);
gadget.empty().append(markup);
if (callback) {
callback(self);
}
});
} else {
gadget.append(data);
gadget.empty().append(data);
if (callback) {
callback(self);
}
......@@ -177,6 +177,7 @@ var RenderJs = (function () {
gadget_js[key] = value;
});
}
if (url !== undefined && url !== "") {
cacheable = gadget.attr("data-gadget-cacheable");
cache_id = gadget.attr("data-gadget-cache-id");
......
......@@ -12,6 +12,7 @@
width: 100%;
overflow: hidden !important;
border: 1px solid #D5D5D5;
background: white;
}
.items_listview li {
float: left;
......
......@@ -125,16 +125,7 @@ define([
spec.source = source;
spec.callback_mockup = callback_mockup;
// if unbound, bind and run once, if bound, just run
if (spec.gadget.sourceSet === undefined) {
spec.gadget.sourceSet = true;
$(document).on("pagebeforeshow", spec.pageId, function (e) {
priv.generateItems(spec);
});
priv.generateItems(spec);
} else {
priv.generateItems(spec);
}
};
that.callback = function (self) {
......
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