diff --git a/admin/themes/clear/theme.css b/admin/themes/clear/theme.css index 1acacbd6e..39e519b34 100644 --- a/admin/themes/clear/theme.css +++ b/admin/themes/clear/theme.css @@ -690,7 +690,7 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important; .addFilesButtonChanged:hover {background-color: #BBB;} #checkActions a, .deleteDerivButtons a {background-color: #E8E8E8;} -#addFilter, #filterList select, .pictureLevels select, #permitAction select {background-color: #FFF; color: #4E4E4E; border: 2px solid #7070704f !important; outline: none !important;} +#filterList select, .pictureLevels select, #permitAction select {background-color: #FFF; color: #4E4E4E; border: 2px solid #7070704f !important; outline: none !important;} #filter_category .selectize-input.items.full.has-options.has-items, #filter_tags .selectize-input.items.not-full.has-options, #filter_tags .selectize-input.items.not-full, #filter_search input, #action_associate .selectize-input.items.full.has-options.has-items, #action_dissociate .selectize-input.items.full.has-options.has-items { @@ -699,7 +699,7 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important; color: #3C3C3CBD; } #action_associate a:last-child {background: #FFF; border: 1px solid #787777a6; box-shadow: none;} -#forbidAction, .selectionEmptyBlock {background-color: #f3f3f3;} +#forbidAction, .selectionEmptyBlock, .noFilter {background-color: #f3f3f3;} #action_title .large, #action_author .large {background-color: #FFF; color: #4E4E4E;} #filter_dimension .slider-choice, #filter_filesize .slider-choice {background-color: #EEE; color: #777;} #filter_dimension .slider-choice:hover, #filter_filesize .slider-choice:hover, .dimension-cancel:hover { diff --git a/admin/themes/default/js/batchManagerGlobal.js b/admin/themes/default/js/batchManagerGlobal.js index f7693c6ae..41bda0fe7 100644 --- a/admin/themes/default/js/batchManagerGlobal.js +++ b/admin/themes/default/js/batchManagerGlobal.js @@ -8,7 +8,10 @@ function filter_enable(filter) { $("input[type=checkbox][name="+filter+"_use]").prop("checked", true); /* forbid to select this filter in the addFilter list */ - $("#addFilter").find("option[value="+filter+"]").attr("disabled", "disabled"); + $("#addFilter").find("a[data-value="+filter+"]").addClass("disabled", "disabled"); + + /* hide the no filter message */ + $('.noFilter').hide(); } function filter_disable(filter) { @@ -19,7 +22,13 @@ function filter_disable(filter) { $("input[name="+filter+"_use]").prop("checked", false); /* give the possibility to show it again */ - $("#addFilter").find("option[value="+filter+"]").removeAttr("disabled"); + $("#addFilter").find("a[data-value="+filter+"]").removeClass("disabled"); + + /* show the no filter message if no filter selected */ + if ($('#filterList li:visible').length == 0) { + $('.noFilter').show(); + } + } $(".removeFilter").addClass("icon-cancel-circled"); @@ -31,10 +40,9 @@ $(".removeFilter").click(function () { return false; }); -$("#addFilter").change(function () { - var filter = $(this).prop("value"); +$("#addFilter a").on('click', function () { + var filter = $(this).attr("data-value"); filter_enable(filter); - $(this).prop("value", -1); }); $("#removeFilters").click(function() { @@ -51,6 +59,13 @@ $('[data-slider=ratios]').pwgDoubleSlider(sliders.ratios); $('[data-slider=filesizes]').pwgDoubleSlider(sliders.filesizes); +$(document).mouseup(function (e) { + e.stopPropagation(); + if (!$(event.target).hasClass('addFilter-button')) { + $('.addFilter-dropdown').slideUp(); + } +}); + /* ********** Thumbs */ /* Shift-click: select all photos between the click and the shift+click */ diff --git a/admin/themes/default/template/batch_manager_global.tpl b/admin/themes/default/template/batch_manager_global.tpl index 529d7ec01..311124c64 100644 --- a/admin/themes/default/template/batch_manager_global.tpl +++ b/admin/themes/default/template/batch_manager_global.tpl @@ -333,32 +333,9 @@ var sliders = {