This patch adds an "in-place" mode to the MARC editor for
cases where client-side MARC munging is needed without
immediately saving the results to the database.
To use, include in-place-mode="true" in the eg-marc-edit-record
directive.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
scope: {
dirtyFlag : '=',
recordId : '=',
- marcXml : '@',
+ marcXml : '=',
+ // in-place mode means that the editor is being
+ // used just to munge some MARCXML client-side, rather
+ // than to (immediately) update the database
+ inPlaceMode : '@',
recordType : '@',
maxUndo : '@'
},
};
$scope.saveRecord = function () {
+ if ($scope.inPlaceMode) {
+ $scope.marcXml = $scope.record.toXmlString();
+ return;
+ }
$scope.mangle_005();
$scope.Record().editor(egCore.auth.user().id());
$scope.Record().edit_date('now');