Changeset 29625

Show
Ignore:
Timestamp:
13.12.2014 00:28:58 (5 years ago)
Author:
davidb
Message:

Finessing of when to show progress bar

Location:
other-projects/nz-flag-design/trunk/similarity-2d
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • other-projects/nz-flag-design/trunk/similarity-2d/display-flags.jsp

    r29624 r29625  
    4545    </div> 
    4646 
    47    <div id="progressArea"> 
     47   <div id="progressArea" style="display: none;"> 
    4848     <span id="loadingLabel">Loading: </span> 
    4949     <div id="progressBar"></div> 
     
    5656 
    5757      if (!is_jsp_active) { 
    58         var mess = "<div>Web server is no JSP active.  Unable to run flag comparison</div>"; 
     58        var mess = "<div>Web server is not JSP active.  Unable to run flag comparison</div>"; 
    5959        $('#flagArea').append(mess); 
    6060      } 
  • other-projects/nz-flag-design/trunk/similarity-2d/flag-processing.js

    r29622 r29625  
    2020function displayFlags(img_list,$displayDiv,$progressArea,$progressBar) 
    2121{ 
    22     var i; 
    23      
     22    var img_list_len = img_list.length; 
     23    var show_progress = 5; 
     24 
     25    if (img_list_len==0) { 
     26    return; 
     27    } 
     28    else if (img_list_len>show_progress) { 
     29    $progressArea.slideDown(); 
     30    } 
     31 
    2432    var root_img_re = /^.*\/(.*?)\..*?$/; 
    2533 
    26     var img_list_len = img_list.length; 
    2734    var progress_step = 100.0 / img_list_len; 
    2835     
    2936    var callback_count = 0; 
    3037     
     38    var i; 
    3139    for (i=0; i<img_list.length; i++) { 
    3240    var img_url     = img_list[i]; 
     
    4351         
    4452        if (callback_count == img_list_len) { 
    45         $progressArea.slideUp(); 
     53        if (img_list_len>show_progress) { 
     54            $progressArea.slideUp(); 
     55        } 
    4656        } 
    4757    };