Store calendar filters per project
This commit is contained in:
parent
746a3f8d23
commit
54d2d46b65
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
<div class="sidebar-content">
|
||||
<div id="calendar"
|
||||
data-project-id="<?= $project['id'] ?>"
|
||||
data-save-url="<?= $this->u('calendar', 'save', array('project_id' => $project['id'])) ?>"
|
||||
data-check-url="<?= $this->u('calendar', 'events', array('project_id' => $project['id'])) ?>"
|
||||
data-check-interval="<?= $check_interval ?>"
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,7 @@
|
|||
Kanboard.Calendar = (function() {
|
||||
|
||||
var filter_storage_key = "";
|
||||
|
||||
// Show the empty calendar
|
||||
function show_calendar()
|
||||
{
|
||||
|
|
@ -65,7 +67,7 @@ Kanboard.Calendar = (function() {
|
|||
// Restore saved filters
|
||||
function load_filters()
|
||||
{
|
||||
var filters = Kanboard.GetStorageItem('calendar_filters');
|
||||
var filters = Kanboard.GetStorageItem(filter_storage_key);
|
||||
|
||||
if (filters !== "undefined" && filters !== "") {
|
||||
filters = JSON.parse(filters);
|
||||
|
|
@ -89,12 +91,13 @@ Kanboard.Calendar = (function() {
|
|||
filters[$(this).attr("name")] = $(this).val();
|
||||
});
|
||||
|
||||
Kanboard.SetStorageItem("calendar_filters", JSON.stringify(filters));
|
||||
Kanboard.SetStorageItem(filter_storage_key, JSON.stringify(filters));
|
||||
refresh_calendar(filters);
|
||||
}
|
||||
|
||||
return {
|
||||
Init: function() {
|
||||
filter_storage_key = "calendar_filters_" + $("#calendar").data("project-id");
|
||||
show_calendar();
|
||||
load_filters();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue