Commit 0eaa8929 authored by Bahadir Can Yildiz's avatar Bahadir Can Yildiz

CHANGE rref #5296. Reverted Changes, made buttons static

parent 1e7fe815
...@@ -3,5 +3,6 @@ ...@@ -3,5 +3,6 @@
<form name="modalForm" sf-schema="schema" sf-form="form" sf-model="model" modal-form-locator></form> <form name="modalForm" sf-schema="schema" sf-form="form" sf-model="model" modal-form-locator></form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button ng-repeat="b in schema.footerButtons" type="{{b.type}}" class="btn {{b.style || 'btn-default'}}" ng-click="onNodeBtnClk(b)">{{b.text}}</button> <button type="submit" class="btn btn-primary" ng-click="onNodeSubmit()">Tamam</button>
<button type="button" class="btn btn-warning" ng-click="cancel()">İptal</button>
</div> </div>
\ No newline at end of file
...@@ -1387,31 +1387,13 @@ angular.module('ulakbus.formService', ['ui.bootstrap']) ...@@ -1387,31 +1387,13 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
} }
}; };
$scope.onNodeBtnClk = function (button) { $scope.onNodeSubmit = function () {
if(!button.form_validate && angular.isDefined(button.form_validate)){
$uibModalInstance.close($scope);
}
else{
$scope.$broadcast('schemaFormValidate'); $scope.$broadcast('schemaFormValidate');
if ($scope.modalForm.$valid) { if ($scope.modalForm.$valid) {
$uibModalInstance.close($scope); $uibModalInstance.close($scope);
} }
else {
// focus to first input with validation error
$timeout(function () {
var firsterror = angular.element(document.querySelectorAll('input.ng-invalid'))[0];
firsterror.focus();
});
}
}
}; };
// $scope.onNodeSubmit = function () {
// $scope.$broadcast('schemaFormValidate');
// if ($scope.modalForm.$valid) {
// $uibModalInstance.close($scope);
// }
// };
$scope.cancel = function () { $scope.cancel = function () {
$uibModalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment