[open-ils-commits] [GIT] Evergreen ILS branch rel_2_12 updated. d42b64946a3187709e0c11d1b35288170eb6a8e7

Evergreen Git git at git.evergreen-ils.org
Fri Jul 21 12:13:55 EDT 2017


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_12 has been updated
       via  d42b64946a3187709e0c11d1b35288170eb6a8e7 (commit)
      from  3b6b6be7f55b8d4b464fe9fa79b190588d86e769 (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 d42b64946a3187709e0c11d1b35288170eb6a8e7
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date:   Thu Jun 29 13:27:40 2017 -0400

    LP#1668314 - Webstaff make marcEditor's flateditor checkbox sticky
    
    Just followed the same pattern of using $watch and localstorage
    to store a boolean for FlatEditor checkbox. Made $scope.flatEditor
    be an object wrapping an isEnabled :bool to avoid *future* ng-if
    parent scope issues that could (potentially) occur.
    
    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    
    Signed-off-by: Josh Stompro <stomproj at larl.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 b/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2
index d7ed391..c9dfdbc 100644
--- a/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2
+++ b/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2
@@ -14,7 +14,7 @@
   <div class="pad-vert row marctypesource">
     <div class="col-md-2 form-group" ng-show="!flatOnly">
       <label>
-        <input type="checkbox" ng-model="flatEditor" ng-change="refreshVisual()"/>
+        <input type="checkbox" ng-model="flatEditor.isEnabled" ng-change="refreshVisual()"/>
         [% l('Flat Text Editor') %]
       </label>
     </div>
@@ -52,10 +52,10 @@
     </div>
   </div>
 
-  <div ng-show="flatEditor">
+  <div ng-show="flatEditor.isEnabled">
     <textarea class="marcflateditor" cols="120" rows="40" ng-model="flat_text_marc" ng-blur="saveFlatTextMARC()"></textarea>
   </div>
-  <div ng-show="!flatEditor">
+  <div ng-show="!flatEditor.isEnabled">
     <div class="row pad-vert">
       <div class="marcffeditor">
         <div class="row col-md-12">
diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
index 1e9460b..fb3a05a 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
@@ -666,7 +666,17 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap'])
                 $scope.enable_fast_add = false;
                 $scope.fast_item_callnumber = '';
                 $scope.fast_item_barcode = '';
-                $scope.flatEditor = $scope.flatOnly ? true : false;
+                
+                $scope.flatEditor = { isEnabled : $scope.flatOnly ? true : false };
+                
+                egCore.hatch.getItem('cat.marcedit.flateditor').then(function(val) {
+                    $scope.flatEditor.isEnabled = val;
+                });
+                
+                $scope.$watch('flatEditor.isEnabled', function (newVal, oldVal) {
+                    if (newVal != oldVal) egCore.hatch.setItem('cat.marcedit.flateditor', newVal);
+                });
+
                 $scope.brandNewRecord = false;
                 $scope.bib_source = null;
                 $scope.record_type = $scope.recordType || 'bre';
@@ -696,7 +706,7 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap'])
                 };
 
                 $scope.refreshVisual = function () {
-                    if (!$scope.flatEditor) {
+                    if (!$scope.flatEditor.isEnabled) {
                         $scope.controlfields = $scope.record.fields.filter(function(f){ return f.isControlfield() });
                         $scope.datafields = $scope.record.fields.filter(function(f){ return !f.isControlfield() });
                     }

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

Summary of changes:
 .../src/templates/staff/cat/share/t_marcedit.tt2   |    6 +++---
 .../js/ui/default/staff/cat/services/marcedit.js   |   14 ++++++++++++--
 2 files changed, 15 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list