<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>
</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">
$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';
};
$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() });
}