[open-ils-commits] [GIT] Evergreen ILS branch rel_2_8 updated. 95cb130677ba997998e39a2afea4b3eea31ac49a

Evergreen Git git at git.evergreen-ils.org
Fri Jun 12 15:59:15 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_8 has been updated
       via  95cb130677ba997998e39a2afea4b3eea31ac49a (commit)
      from  7b3eae1fe7935238097583437f0fb7dddacfb855 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 95cb130677ba997998e39a2afea4b3eea31ac49a
Author: Michael Peters <mpeters at emeralddata.net>
Date:   Tue Jun 9 10:10:04 2015 -0400

    LP#1154656 MARC Expert Search "Add Rows" adds duplicate row
    
    This patch changes the behavior of the "Add Search Row" link
    (JavaScript function from simple.js "addExpertRow()") so that
    we are always cloning the initial "empty" row instead of
    potentially cloning a row -- by way of cloneNode() -- with user
    input in place, and causing duplicate search rows.
    
    To reproduce the bug, go to Advanced Search, fill in all three
    search fields with some text, click on Add Search Row.  You wil
    see that the Title search row along with the data in the text
    box is duplicated and added to the search.
    
    After this patch, the new row should be added with an empty
    text box.
    
    Signed-off-by: Michael Peters <mpeters at emeralddata.net>
    Signed-off-by: Rashma Kumaran <rkumaran at kcls.org>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>

diff --git a/Open-ILS/src/templates/opac/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2
index 56cbef8..cafccb6 100644
--- a/Open-ILS/src/templates/opac/css/style.css.tt2
+++ b/Open-ILS/src/templates/opac/css/style.css.tt2
@@ -2101,4 +2101,10 @@ See also http://webaim.org/techniques/css/invisiblecontent/
     overflow: hidden;                                                            
     clip: rect(0, 0, 0, 0);                                                      
     border: 0;                                                                   
-} 
+}
+
+/* Make added rows in Expert Search have bold labels like the initial row */
+label[for*=expert_]
+{
+    font-weight: bold;
+}  
diff --git a/Open-ILS/web/js/ui/default/opac/simple.js b/Open-ILS/web/js/ui/default/opac/simple.js
index b491586..7fa20cb 100644
--- a/Open-ILS/web/js/ui/default/opac/simple.js
+++ b/Open-ILS/web/js/ui/default/opac/simple.js
@@ -26,18 +26,33 @@ function addSearchRow() {
         _search_row_template.cloneNode(true),
         $("adv_global_addrow")
     );
+
+    $("adv_global_input_table").rows[$("adv_global_input_table").rows.length - 2].getElementsByTagName("input")[0].value = "";
 }
-function addExpertRow() {
-    if (!_expert_row_template) {
-        t = $("adv_expert_row").cloneNode(true);
-        t.id = null;
-        _expert_row_template = t;
-    }
 
+(function($){
+var _search_row_template, _expert_row_template, t;
+var _el_adv_global_row = $("adv_global_row"), _el_adv_expert_row = $("adv_expert_row");
+if (_el_adv_global_row) {
+    t = _el_adv_global_row.cloneNode(true);
+    t.id = null;
+    _search_row_template = t;
+}
+
+if (_el_adv_expert_row) {
+    t = _el_adv_expert_row.cloneNode(true);
+    t.id = null;
+    _expert_row_template = t;
+}
+function addExpertRow() {
     $("adv_expert_rows_here").appendChild(
         _expert_row_template.cloneNode(true)
     );
 }
+
+window.addSearchRow = addSearchRow;
+window.addExpertRow = addExpertRow;
+})($);
 function killRowIfAtLeast(min, link) {
     var row = link.parentNode.parentNode;
     if (row.parentNode.getElementsByTagName("tr").length > min)

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/templates/opac/css/style.css.tt2 |    8 ++++++-
 Open-ILS/web/js/ui/default/opac/simple.js     |   27 +++++++++++++++++++-----
 2 files changed, 28 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list