Bug 15832: Remove empty string from the filters
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 5 Apr 2016 06:40:21 +0000 (07:40 +0100)
committerFrédéric Demians <f.demians@tamil.fr>
Wed, 27 Apr 2016 15:00:33 +0000 (17:00 +0200)
On each cell, the split will generate a new empty entry.
This patch removes that entry.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
(cherry picked from commit 1931ff465317aa2bf8d31c0c817ff0c4d75ea8dc)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
(cherry picked from commit ef6c60d8ccc93832f87f7b6fe1f3daa5ce48dda9)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt

index 901961b..e96a9e7 100644 (file)
@@ -29,8 +29,7 @@ $(document).ready(function() {
         var split_array = cD[j].split(/<br>/gi);
         for ( k=0 ; k<split_array.length ; k++ ){
             var str = $.trim(split_array[k].replace(/[\n\r]/g, ''));
-            var check_array = $.inArray(str, new_array);
-            if (check_array == -1) {
+            if ($.inArray(str, new_array) == -1 && str.length > 0 ) {
                 new_array.push(str);
             }
         }