Bug 17808: Fix behavior when editing a circ rule

The original behavior is broken, see https://stackoverflow.com/questions/21410484/jquery-selector-to-find-out-count-of-non-empty-inputs

Test plan:
Edit a circ rule
=> Without this patch you get a useless message
=> With this patch, no message
Edit a circ rule with content in inputs
=> With or without this patch you get a useful message

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2016-12-23 09:18:03 +00:00 committed by Kyle M Hall
parent 6ddd4b2f5f
commit 5a9ffa92ce
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ $(document).ready(function() {
$('#selectlibrary').submit();
});
$(".editrule").click(function(){
if ( $(edit_row).find("input[type='text'][value!='']").length > 0 ) {
if ( $("#edit_row").find("input[type='text']").filter(function(){return this.value.length > 0 }).length > 0 ) {
var edit = confirm(_("Are you sure you want to edit another rule?"));
if (!edit) return false;
}