This commit is contained in:
1 parent
7224137ed2
commit
52cb59f33f
8 files changed
+60
-9
No files matched your search
@@ -188,6 +188,9 @@
|
||||
var n = selectedKeys().length;
|
||||
el('batch').hidden = !n;
|
||||
el('batch-count').textContent = t('已选 %1 项', n);
|
||||
var all = el('b-all');
|
||||
all.hidden = !n || !data || n >= data.total;
|
||||
all.textContent = t('选中全部 %1 个', data ? data.total : 0);
|
||||
}
|
||||
function render() {
|
||||
renderGroups();
|
||||
@@ -420,6 +423,14 @@
|
||||
run(function () { return post('enable', { keys: selectedKeys(), enabled: false }); }, t('完成'));
|
||||
};
|
||||
el('b-delete').onclick = function () { removeKeys(selectedKeys()); };
|
||||
el('b-all').onclick = function () {
|
||||
var qs = 'status=' + (cur === ALL ? '' : cur) + '&q=' + encodeURIComponent(el('q').value.trim());
|
||||
jfetch(API + 'keys?' + qs, { cache: 'no-store' }).then(function (d) {
|
||||
sel = {};
|
||||
(Array.isArray(d.keys) ? d.keys : []).forEach(function (k) { sel[k] = true; });
|
||||
renderList();
|
||||
}).catch(fail);
|
||||
};
|
||||
el('b-clear').onclick = function () { sel = {}; renderList(); };
|
||||
el('q').oninput = function () {
|
||||
clearTimeout(searchTimer);
|
||||
|
||||
Reference in new issue
Block a user