webstaff: changing pattern now marks form dirty
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 5 May 2017 20:12:51 +0000 (16:12 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 5 May 2017 20:12:51 +0000 (16:12 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/templates/staff/serials/t_prediction_manager.tt2
Open-ILS/web/js/ui/default/staff/serials/directives/prediction_manager.js

index a68e181..f406013 100644 (file)
@@ -4,7 +4,7 @@
 
 <div>
   <div class="row" ng-repeat="pred in predictions | orderBy: 'id' as filtered track by pred.id">
-    <ng-form name="predform" class="form-inline">
+    <ng-form name="pred.predform" class="form-inline">
     <div class="col-md-1"><label>[% l('ID') %] {{pred.id}}</label></div>
     <div class="col-md-1">
       <label class="checkbox-inline">
@@ -25,7 +25,7 @@
         <button class="btn btn-default" ng-click="openPatternEditorDialog(pred)">[% l('Edit Pattern') %]</button>
     </div>
     <div>
-        <button class="btn btn-primary" ng-disabled="!predform.$dirty">[% l('Save') %]</button>
+        <button class="btn btn-primary" ng-disabled="!pred.predform.$dirty">[% l('Save') %]</button>
     </div>
     </form>
   </div>
index e64ebb1..2a45a95 100644 (file)
@@ -43,7 +43,7 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider ,
         }).result.then(function (patternCode) {
             if (pred.patternCode !== patternCode) {
                 pred.patternCode = patternCode;
-                
+                pred.predform.$setDirty();        
             }
         });
     }