|
|
@ -874,14 +874,27 @@ define([
|
|
|
|
// Tags filter
|
|
|
|
// Tags filter
|
|
|
|
var existing = getExistingTags(kanban.options.boards);
|
|
|
|
var existing = getExistingTags(kanban.options.boards);
|
|
|
|
var list = h('div.cp-kanban-filterTags-list');
|
|
|
|
var list = h('div.cp-kanban-filterTags-list');
|
|
|
|
var reset = h('span.cp-kanban-filterTags-reset', [h('i.fa.fa-times'), Messages.kanban_clearFilter]);
|
|
|
|
var reset = h('span.cp-kanban-filterTags-reset', [
|
|
|
|
|
|
|
|
//h('i.fa.fa-times'), // XXX creates vertical alignment issues
|
|
|
|
|
|
|
|
Messages.kanban_clearFilter
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
var hint = h('span.cp-kanban-filterTags-name', Messages.kanban_tags);
|
|
|
|
var tags = h('div.cp-kanban-filterTags', [
|
|
|
|
var tags = h('div.cp-kanban-filterTags', [
|
|
|
|
h('span.cp-kanban-filterTags-name', Messages.kanban_tags),
|
|
|
|
h('span.cp-kanban-filterTags-toggle', [
|
|
|
|
|
|
|
|
hint,
|
|
|
|
|
|
|
|
reset,
|
|
|
|
|
|
|
|
]),
|
|
|
|
list,
|
|
|
|
list,
|
|
|
|
reset
|
|
|
|
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
var $reset = $(reset);
|
|
|
|
var $reset = $(reset);
|
|
|
|
var $list = $(list);
|
|
|
|
var $list = $(list);
|
|
|
|
|
|
|
|
var $hint = $(hint);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var setTagFilterState = function (bool) {
|
|
|
|
|
|
|
|
$hint.css('display', bool? 'none': 'inherit');
|
|
|
|
|
|
|
|
$reset.css('display', bool? 'inherit': 'none');
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
setTagFilterState();
|
|
|
|
|
|
|
|
|
|
|
|
var getTags = function () {
|
|
|
|
var getTags = function () {
|
|
|
|
return $list.find('span.active').map(function () {
|
|
|
|
return $list.find('span.active').map(function () {
|
|
|
@ -890,11 +903,7 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var commitTags = function () {
|
|
|
|
var commitTags = function () {
|
|
|
|
var t = getTags();
|
|
|
|
var t = getTags();
|
|
|
|
if (t.length) {
|
|
|
|
setTagFilterState(t.length);
|
|
|
|
$reset.css('visibility', '');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$reset.css('visibility', 'hidden');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//framework._.sfCommon.setPadAttribute('tagsFilter', t);
|
|
|
|
//framework._.sfCommon.setPadAttribute('tagsFilter', t);
|
|
|
|
kanban.options.tags = t;
|
|
|
|
kanban.options.tags = t;
|
|
|
|
kanban.setBoards(kanban.options.boards);
|
|
|
|
kanban.setBoards(kanban.options.boards);
|
|
|
@ -938,14 +947,11 @@ define([
|
|
|
|
return $(this).data('tag') === t;
|
|
|
|
return $(this).data('tag') === t;
|
|
|
|
}).addClass('active');
|
|
|
|
}).addClass('active');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (tags.length) {
|
|
|
|
setTagFilterState(tags.length);
|
|
|
|
$reset.css('visibility', '');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$reset.css('visibility', 'hidden');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//framework._.sfCommon.setPadAttribute('tagsFilter', tags);
|
|
|
|
//framework._.sfCommon.setPadAttribute('tagsFilter', tags);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
$reset.css('visibility', 'hidden').click(function () {
|
|
|
|
setTagFilterState();
|
|
|
|
|
|
|
|
$reset.click(function () {
|
|
|
|
setTags([]);
|
|
|
|
setTags([]);
|
|
|
|
commitTags();
|
|
|
|
commitTags();
|
|
|
|
});
|
|
|
|
});
|
|
|
|