mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 21:47:59 +01:00
add quick tag button to toggle all
This commit is contained in:
parent
074453ddf1
commit
50da6c7f3c
2 changed files with 9 additions and 0 deletions
|
@ -21,6 +21,7 @@ function toggleActiveState() {
|
||||||
|
|
||||||
toggleEl($('.js-quick-tag'),
|
toggleEl($('.js-quick-tag'),
|
||||||
$('.js-quick-tag--abort'),
|
$('.js-quick-tag--abort'),
|
||||||
|
$('.js-quick-tag--all'),
|
||||||
$('.js-quick-tag--submit'));
|
$('.js-quick-tag--submit'));
|
||||||
|
|
||||||
setTagButton(`Submit (${currentTags()})`);
|
setTagButton(`Submit (${currentTags()})`);
|
||||||
|
@ -85,12 +86,17 @@ function modifyImageQueue(mediaBox) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleAllImages() {
|
||||||
|
$$('#imagelist-container .media-box').forEach(modifyImageQueue);
|
||||||
|
}
|
||||||
|
|
||||||
function clickHandler(event) {
|
function clickHandler(event) {
|
||||||
|
|
||||||
const targets = {
|
const targets = {
|
||||||
'.js-quick-tag': activate,
|
'.js-quick-tag': activate,
|
||||||
'.js-quick-tag--abort': reset,
|
'.js-quick-tag--abort': reset,
|
||||||
'.js-quick-tag--submit': submit,
|
'.js-quick-tag--submit': submit,
|
||||||
|
'.js-quick-tag--all': toggleAllImages,
|
||||||
'.media-box': modifyImageQueue,
|
'.media-box': modifyImageQueue,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,9 @@ a.js-quick-tag href="#" title="Add tags to the images on this page"
|
||||||
a.js-quick-tag--abort.hidden href="#"
|
a.js-quick-tag--abort.hidden href="#"
|
||||||
i.fa.fa-exclamation-triangle
|
i.fa.fa-exclamation-triangle
|
||||||
span.hide-mobile.hide-limited-desktop<> Abort Tagging
|
span.hide-mobile.hide-limited-desktop<> Abort Tagging
|
||||||
|
a.js-quick-tag--all.hidden href="#"
|
||||||
|
i.fa.fa-arrows-alt-h
|
||||||
|
span.hide-mobile.hide-limited-desktop<> Toggle All
|
||||||
a.js-quick-tag--submit.hidden href="#"
|
a.js-quick-tag--submit.hidden href="#"
|
||||||
i.fa.fa-tags
|
i.fa.fa-tags
|
||||||
span.hide-mobile.hide-limited-desktop<> Submit Tag Changes
|
span.hide-mobile.hide-limited-desktop<> Submit Tag Changes
|
||||||
|
|
Loading…
Reference in a new issue