summaryrefslogtreecommitdiff
path: root/assets/js/board.js
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-01-05 21:41:23 -0500
committerFrederic Guillot <fred@kanboard.net>2015-01-05 21:41:23 -0500
commit7746773ab9426c9e7fbccb608ff3199d522a5227 (patch)
tree9d41fb68e99d52f7b4d40fd85281a2307c716216 /assets/js/board.js
parent23b84cf12126fb284e5c5cb95774e7d4cc7b0884 (diff)
Add prefix for local storage keys
Diffstat (limited to 'assets/js/board.js')
-rw-r--r--assets/js/board.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/assets/js/board.js b/assets/js/board.js
index 00d2efdd..d3a77866 100644
--- a/assets/js/board.js
+++ b/assets/js/board.js
@@ -214,12 +214,12 @@ Kanboard.Board = (function() {
}
});
- //Save filter settings for active project to localStorage
+ // Save filter settings for active project to localStorage
if (typeof(Storage) !== "undefined") {
var projectId = $('#board').data('project-id');
- localStorage.setItem(projectId + "_form-user_id", selectedUserId);
- localStorage.setItem(projectId + "_form-category_id", selectedCategoryId);
- localStorage.setItem(projectId + "_filter-due-date", ~~(filterDueDate));
+ localStorage.setItem("filters_" + projectId + "_form-user_id", selectedUserId);
+ localStorage.setItem("filters_" + projectId + "_form-category_id", selectedCategoryId);
+ localStorage.setItem("filters_" + projectId + "_filter-due-date", ~~(filterDueDate));
}
}
@@ -239,16 +239,16 @@ Kanboard.Board = (function() {
// Get and set filters from localStorage for active project
if (typeof(Storage) !== "undefined") {
var projectId = $('#board').data('project-id');
- $("#form-user_id").val(localStorage.getItem(projectId + "_form-user_id") || -1);
- $("#form-category_id").val(localStorage.getItem(projectId + "_form-category_id") || -1);
+
+ $("#form-user_id").val(localStorage.getItem("filters_" + projectId + "_form-user_id") || -1);
+ $("#form-category_id").val(localStorage.getItem("filters_" + projectId + "_form-category_id") || -1);
- if (+localStorage.getItem(projectId + "_filter-due-date")) {
+ if (+localStorage.getItem("filters_" + projectId + "_filter-due-date")) {
$("#filter-due-date").addClass("filter-on");
} else {
$("#filter-due-date").removeClass("filter-on");
}
- // apply filters on load
filter_apply();
}
}