Commit 626c6885 authored by Sven Franck's avatar Sven Franck

Gadgets/details: disabled item caching until after debug

parent 97b06fdc
......@@ -3,6 +3,9 @@
vertical-align: top;
width: 45%;
}
.details_element_last {
float: right;
}
@media (max-width: 40em) {
.details_element {
width: 100%;
......
......@@ -80,12 +80,6 @@
}'>
</div>
<!-- item details -->
<div id="description"
data-gadget="modules/description/description.html"
data-gadget-module="description">
</div>
</div>
<!-- footer -->
......
......@@ -65,7 +65,6 @@ define([
id = response._id;
App.cacheItems[id] = [response, now];
App.activeItem = id;
// memory
priv.cleanupMemory(App.cacheItems);
......@@ -80,30 +79,40 @@ define([
// response object
that.data = source;
that.before = function (source, callback_mockup) {
var spec = {};
spec.gadget = RenderJs.getSelfGadget();
// TODO: this is for page event bindings. Once JQM content replaces
// page, remove this and make the gadget the content section to
// be updated.
spec.page = App.util.closest(spec.gadget.dom.get(0), "div[data-role='page']");
spec.pageId = "#" + spec.page.id;
spec.source = source;
spec.callback_mockup = callback_mockup;
if (!spec.page.getAttribute("events_details")) {
spec.page.setAttribute("events_details", true);
$(document).on("pagebeforeshow.details", spec.pageId, function (e, data) {
// TODO: if we allow to reload, we also need to trigger refresh on
// so we need to reload this every time a page is shown. question
// is how to trigger a refresh on this element ONLY
priv.storeItem(spec);
});
// and run intial
priv.storeItem(spec);
}
};
// TODO: this does not work.. if it's run on BEFORE, the 2nd reloaded page
// does not trigger getRecursiveGadgets
// if run on AFTER, the page does not load when loaded directly.
// Either way, this is crap. We should be able to fetch the item from the
// URL here, jIO get, keep the response in memory and have all gadgets on
// this page query memory vs every gadget making the same call to jIO.
// FIX!!!
// TODO: this should also fetch the full document along with attachments,
// while all other request should only work with the "meta" data.
// that.before = function (source, callback_mockup) {
// var spec = {};
//
// spec.gadget = RenderJs.getSelfGadget();
// // TODO: this is for page event bindings. Once JQM content replaces
// // page, remove this and make the gadget the content section to
// // be updated.
// spec.page = App.util.closest(spec.gadget.dom.get(0), "div[data-role='page']");
// spec.pageId = "#" + spec.page.id;
// spec.source = source;
// spec.callback_mockup = callback_mockup;
//
// if (!spec.page.getAttribute("events_details")) {
// spec.page.setAttribute("events_details", true);
// $(document).on("pagebeforeshow.details", spec.pageId, function (e, data) {
// // TODO: if we allow to reload, we also need to trigger refresh on
// // so we need to reload this every time a page is shown. question
// // is how to trigger a refresh on this element ONLY
// priv.storeItem(spec);
// });
// // and run intial
// priv.storeItem(spec);
// }
// };
that.after = function (self) {
if (App === undefined) {
......
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