[open-ils-commits] [GIT] Evergreen ILS branch master updated. d17aa5b825261cbaf1614fd7fcfbb86026fcd410

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, master has been updated
       via  d17aa5b825261cbaf1614fd7fcfbb86026fcd410 (commit)
      from  40f820cd23345ca8e4bb6caf249f6ffe52afe94c (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 d17aa5b825261cbaf1614fd7fcfbb86026fcd410
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