Commit 3fb4020d authored by Sven Franck's avatar Sven Franck

search: added pagebeforeshow method call when loading same page again

parent e8d8d423
......@@ -17,16 +17,25 @@ define([
var matchesSelector = elem.matches ||
elem.webkitMatchesSelector ||
elem.mozMatchesSelector ||
elem.msMatchesSelector;
while (elem) {
if (matchesSelector.bind(elem)(selector)) {
return elem;
} else {
elem = elem.parentNode;
elem.msMatchesSelector,
oldbrowserReturn;
if (matchesSelector) {
while (elem) {
if (matchesSelector.bind(elem)(selector)) {
return elem;
} else {
elem = elem.parentNode;
}
}
return false;
} else {
oldbrowserReturn = $( elem ).closest( selector );
if (oldBrowserReturn.length > 0) {
return oldBrowserReturn;
}
return false;
}
return false;
};
// generate items to display
......@@ -125,7 +134,14 @@ define([
spec.source = source;
spec.callback_mockup = callback_mockup;
priv.generateItems(spec);
if (!spec.page.getAttribute("items_tag")) {
spec.page.setAttribute("items_tag", "true");
$(document).on("pagebeforeshow.items", spec.pageId, function (e) {
priv.generateItems(spec);
});
// and run intial
priv.generateItems(spec);
}
};
that.callback = function (self) {
......
......@@ -12,7 +12,6 @@ define([
value, runSearch;
runSearch = function (value) {
console.log("running search with value ="+value);
$.mobile.changePage( "products.html", {
"transition": "slide",
"allowSamePageTransition": true,
......
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