Skip to content
This repository was archived by the owner on Sep 7, 2020. It is now read-only.

Commit 698b280

Browse files
committed
fix a possible bug if the user types in during a save call the last modification will not be saved. Can happen only if auto save is on.
1 parent 158ea08 commit 698b280

File tree

6 files changed

+3917
-9330
lines changed

6 files changed

+3917
-9330
lines changed

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-auto-save-form",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"main": [
55
"dist/auto-save-form.js",
66
"dist/auto-save-form.css"
@@ -10,7 +10,7 @@
1010
"lodash": ">=4.x"
1111
},
1212
"devDependencies": {
13-
"angular-material": "1.1.3",
13+
"angular-material": "1.1.4",
1414
"angular-mocks": "~1.x",
1515
"angular-mocke2e-maydelay": "~1.0.2"
1616
},

dist/auto-save-form.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
autoSaveForm.$inject = ["$parse", "autoSaveForm", "$log"];
1111
angular.module('angular-auto-save-form', [])
12-
.provider('autoSaveForm', autoSaveFormProvider)
13-
.directive('autoSaveForm', autoSaveForm)
14-
.directive('autoSaveFormProperty', autoSaveFormProperty);
12+
.provider('autoSaveForm', autoSaveFormProvider)
13+
.directive('autoSaveForm', autoSaveForm)
14+
.directive('autoSaveFormProperty', autoSaveFormProperty);
1515

1616
/** @ngInject */
1717
function autoSaveFormProvider() {
@@ -110,8 +110,11 @@
110110
cycleForm(formModel);
111111

112112
var invoker = $parse(attributes.autoSaveForm);
113-
var promise = invoker(scope, {controls: controls, $event: event});
114-
if (promise) {
113+
var promise = invoker(scope, {
114+
controls: controls,
115+
$event: event
116+
});
117+
if (promise && !saveFormAuto) {
115118
if (saveFormSpinner) {
116119
saveFormSpinnerElement.addClass('spin');
117120
}

0 commit comments

Comments
 (0)