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