Skip to content

Commit 36dd0e9

Browse files
Merge branch 'dev-arbo' of https://bitbucket.org/letscomunicadev/angular-framework-core into dev-arbo
2 parents 9012588 + 48c2c05 commit 36dd0e9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/controllers/lets-crud-edit.controller.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
$scope.$emit('refresh-headers');
1313

1414
$scope.datepickers = {};
15+
$scope.loading_http_request = false;
1516
$scope.datepickerToggle = function (name) {
1617
if ($scope.datepickers[name] == undefined) {
1718
$scope.datepickers[name] = false;
@@ -203,7 +204,7 @@
203204
ngToast.warning(_messages.join("<br />"));
204205
}
205206
else if (this.crudForm.$valid) {
206-
207+
$_scope.loading_http_request = true;
207208
function nextBefore(){
208209
if($_scope.headers.tabs){
209210
Object.keys($_scope.headers.tabs).forEach(function(tab){
@@ -224,6 +225,7 @@
224225
response.then(function (resp) {
225226

226227
function nextAfter(){
228+
$_scope.loading_http_request = false;
227229
$state.go($state.current.name.replace('.edit', '.list').replace('.new', '.list'), {filter:$scope.getFilter()});
228230
}
229231

@@ -234,7 +236,7 @@
234236

235237
}, function errorCallback(error) {
236238
var messages = [];
237-
239+
$_scope.loading_http_request = false;
238240
function findLabel(name) {
239241
for (var _x in $_scope.headers.fields) {
240242
var field = $_scope.headers.fields[_x];

src/views/crud/crud-form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<div class="form-actions">
7575
<div class="row">
7676
<div class="col-sm-offset-4 col-sm-7">
77-
<button ng-if="!headers.disabled" type="submit" class="btn btn-big btn-primary">
77+
<button ng-if="!headers.disabled" type="submit" class="btn btn-big btn-primary" ng-class="{'disabled': loading_http_request}">
7878
<span class="icon fa fa-floppy-o"></span>Salvar</button>
7979
<button type="button" class="btn btn-big btn-inverse" ng-click="cancel()">
8080
<span class="icon fa fa-undo"></span>Cancelar</button>

0 commit comments

Comments
 (0)