<button class="btn btn-warning" ng-click="startNewScap()">[% l('Add New') %]</button>
<button class="btn btn-warning" ng-click="importScapFromBibRecord()">[% l('Import from Bibliographic and/or MFHD Records') %]</button>
<button class="btn btn-warning" ng-click="importScapFromSpt()">[% l('Create from Template') %]</button>
- <select ng-model="active_pattern_template.id" ng-options="spt as spt.name for spt in pattern_templates track by spt.id">
+ <select ng-model="active_pattern_template.id" ng-options="spt.id as spt.name for spt in pattern_templates | orderBy:'name'">
</select>
</div>
<div class="row" ng-if="new_prediction">
templateUrl: './serials/t_prediction_manager',
controller:
['$scope','$q','egSerialsCoreSvc','egCore','egGridDataProvider',
- '$uibModal',
+ '$uibModal','$timeout',
function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider ,
- $uibModal) {
+ $uibModal , $timeout) {
egSerialsCoreSvc.fetch($scope.bibId).then(function() {
reload($scope.ssubId);
break;
}
}
+ // Mark form dirty because, when it's created from a template,
+ // it can be immediately saved if the user so chooses. The
+ // $timeout() allows this to happen after the form is bound
+ // is bound to $scope.new_prediction.
+ $timeout(function() { $scope.new_prediction.predform.$setDirty() });
}
$scope.openPatternEditorDialog = function(pred) {