Make search work properly when list reload triggered
This commit is contained in:
parent
07c5b3c2d7
commit
0b4a579617
@ -20,16 +20,8 @@ $(".view-main").on("swipeout:delete", "#addresslist .package-list-item", functio
|
|||||||
deletePackage($(this).data("packageid"));
|
deletePackage($(this).data("packageid"));
|
||||||
});
|
});
|
||||||
|
|
||||||
var searchbar = app.searchbar.create({
|
// Searchbar is setup in routes.js, this is for forcing a wider scope
|
||||||
el: '.package-list-searchbar',
|
var searchbar = null;
|
||||||
searchContainer: '#addresslist',
|
|
||||||
searchIn: '.item-title',
|
|
||||||
on: {
|
|
||||||
search(sb, query, previousQuery) {
|
|
||||||
console.log(query, previousQuery);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update package distances relative to the passed coordinates.
|
* Update package distances relative to the passed coordinates.
|
||||||
@ -147,6 +139,13 @@ function loadPackageList(sortType) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If there was a search open when the reload was triggered
|
||||||
|
var searchboxVal = $(".package-list-searchbar input[type=search]").val();
|
||||||
|
if (searchboxVal != "") {
|
||||||
|
searchbar.clear();
|
||||||
|
searchbar.search(searchboxVal);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirmDeleteAllPackages() {
|
function confirmDeleteAllPackages() {
|
||||||
|
@ -38,7 +38,7 @@ var routes = [
|
|||||||
pageAfterIn: function () {
|
pageAfterIn: function () {
|
||||||
loadPackageList();
|
loadPackageList();
|
||||||
|
|
||||||
var searchbar = app.searchbar.create({
|
searchbar = app.searchbar.create({
|
||||||
el: '.package-list-searchbar',
|
el: '.package-list-searchbar',
|
||||||
searchContainer: '#addresslist',
|
searchContainer: '#addresslist',
|
||||||
searchIn: '.item-title',
|
searchIn: '.item-title',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user