Bug 18551 - Hide with CSS dynamic elements in member search
authorFridolin Somers <fridolin.somers@biblibre.com>
Fri, 5 May 2017 13:00:05 +0000 (15:00 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 19 May 2017 14:49:53 +0000 (10:49 -0400)
In member search page, the result table is in Ajax so fully managed by Javascript. There is also a yellow dialog message prepared in HTML.

Thoses elements are hidden by JS code : ie $("#patron_list_dialog").hide().

The problem is that the static page is first loaded an displayed then the JS code runs an hides the elements.
On a low performance computer, this action is visible and looks like there is a blinking yellow message.

I propose to hide with CSS so that thoses elements are not displayed in static page and are there shown in dynamic JS code.

Test plan :
Check display is unchanged :
- Go to home page /cgi-bin/koha/members/members-home.pl
- Perform patron search from header search box
- Perform patron search by clicking on a letter
- Perform patron search from filters (left of results table)
- Select a patron and add it to a list => you see the yellow message

Yellow message does no longer appear with this patch.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>

Signed-off-by: Philippe <philippe.audet-fortin@inlibro.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt

index faf13d1..7c8c960 100644 (file)
@@ -37,7 +37,6 @@ $(document).ready(function() {
         }
     });
 
-    $("#patron_list_dialog").hide();
     $("#add_to_patron_list_submit").on('click', function(e){
         if ( $('#add_to_patron_list').val() == 'new' ) {
             if ( $('#new_patron_list').val() ) {
@@ -132,8 +131,9 @@ $(document).ready(function() {
     [% END %]
 
     [% IF view != "show_results" %]
-        $("#searchresults").hide();
         search = 0;
+    [% ELSE %]
+        $("#searchresults").show();
     [% END %]
 
     // Build the aLengthMenu
@@ -328,7 +328,7 @@ function filterByFirstLetterSurname(letter) {
       <div class="yui-b">
         <div class="yui-g">
           [% IF CAN_user_tools_manage_patron_lists %]
-            <div id="patron_list_dialog" class="dialog alert">
+            <div id="patron_list_dialog" class="dialog alert" style="display:none">
               Added <span class="patrons-length"></span> patrons to <a></a>.
             </div>
           [% END %]
@@ -355,7 +355,7 @@ function filterByFirstLetterSurname(letter) {
             </div>
           [% END %]
 
-          <div id="searchresults">
+          <div id="searchresults" style="display:none">
             <div id="searchheader">
               <h3>Patrons found for: <span id="searchpattern">[% IF searchmember %] for '[% searchmember %]'[% END %]</span></h3>
             </div>