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

search: added pagebeforeshow method call when loading same page again

parent e8d8d423
......@@ -17,8 +17,10 @@ define([
var matchesSelector = elem.matches ||
elem.webkitMatchesSelector ||
elem.mozMatchesSelector ||
elem.msMatchesSelector;
elem.msMatchesSelector,
oldbrowserReturn;
if (matchesSelector) {
while (elem) {
if (matchesSelector.bind(elem)(selector)) {
return elem;
......@@ -27,6 +29,13 @@ define([
}
}
return false;
} else {
oldbrowserReturn = $( elem ).closest( selector );
if (oldBrowserReturn.length > 0) {
return oldBrowserReturn;
}
return false;
}
};
// generate items to display
......@@ -125,7 +134,14 @@ define([
spec.source = source;
spec.callback_mockup = callback_mockup;
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