lp1836808 add cancel button to merge edit user/mrisher/lp1836808-merge-edit-close-button
authorMike Risher <mrisher@catalyte.io>
Wed, 17 Jul 2019 17:26:34 +0000 (17:26 +0000)
committerMike Risher <mrisher@catalyte.io>
Tue, 30 Jul 2019 22:52:35 +0000 (22:52 +0000)
In the merge UI add a button so one can cancel out of editing mode

Signed-off-by: Mike Risher <mrisher@catalyte.io>
Changes to be committed:
modified:   Open-ILS/src/templates/staff/cat/bucket/record/t_merge_records.tt2
modified:   Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js

Open-ILS/src/templates/staff/cat/bucket/record/t_merge_records.tt2
Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js

index cdfed19..ed53fb0 100644 (file)
@@ -41,6 +41,8 @@
                 ng-click="edit_lead_inplace()">[% l('Edit') %]</button>
               <button class="btn btn-default btn-sm" ng-class="{disabled : editing_inplace}" 
                 ng-click="edit_lead()">[% l('Edit using full editor') %]</button>
+              <button class="btn btn-default btn-sm" ng-show="editing_inplace" 
+                ng-click="cancel_edit_lead_inplace()">[% l('Cancel Edit') %]</button>
               <eg-marc-edit-record dirty-flag="dirty_flag" marc-xml="lead.marc_xml"
                  in-place-mode="true" record-type="bre" embedded="true" 
                  ng-show="editing_inplace" on-save="post_edit_inplace">
index 8aaa4db..14ebe42 100644 (file)
@@ -664,8 +664,15 @@ function($scope,  $q , $routeParams,  bucketSvc,  egCore,  $window,
                     updateOneRecord($scope.lead_id, $scope.lead.marc_xml);
                 }
 
+                $scope.cancel_edit_lead_inplace = function() {
+                    $scope.editing_inplace = false;
+                    $scope.lead.marc_xml = $scope.lead.orig_marc_xml;
+                }
+
                 $scope.edit_lead_inplace = function() {
                     $scope.editing_inplace = true;
+                    let lead = { orig_marc_xml : $scope.lead.marc_xml };
+                    $scope.lead = lead;
                 }
                 $scope.edit_lead = function() {
                     var lead = { marc_xml : $scope.lead.marc_xml };