@azrico/webobject 1.4.163 → 1.4.165

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -173,56 +173,80 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
173
173
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
174
174
  while (1) switch (_context2.prev = _context2.next) {
175
175
  case 0:
176
- _context2.next = 2;
176
+ _context2.prev = 0;
177
+ if (!this.manager) {
178
+ _context2.next = 6;
179
+ break;
180
+ }
181
+ _context2.next = 4;
182
+ return this.manager.setOption("saving", true);
183
+ case 4:
184
+ _context2.next = 6;
185
+ return this.manager.setOption("loading", true);
186
+ case 6:
187
+ _context2.next = 8;
177
188
  return this.get_deltaObject();
178
- case 2:
189
+ case 8:
179
190
  deltaObject = _context2.sent;
180
191
  putAction = "post";
181
- _context2.next = 6;
192
+ _context2.next = 12;
182
193
  return _WebObjectPathHelper["default"].get_path(this, this.isNew ? "new" : "save");
183
- case 6:
194
+ case 12:
184
195
  usepath = _context2.sent;
185
196
  if ((0, _object.object_isEmpty)(deltaObject)) {
186
- _context2.next = 20;
197
+ _context2.next = 26;
187
198
  break;
188
199
  }
189
200
  canSaveResult = this.canSave(deltaObject);
190
201
  if (!(canSaveResult !== true)) {
191
- _context2.next = 13;
202
+ _context2.next = 19;
192
203
  break;
193
204
  }
194
205
  WebObject.addError(this, "Save not allowed", String(canSaveResult), true);
195
206
  this.setSaveResult(false, "canceled");
196
207
  return _context2.abrupt("return", false);
197
- case 13:
198
- _context2.next = 15;
208
+ case 19:
209
+ _context2.next = 21;
199
210
  return _global.gfunc.run_action(putAction, usepath, deltaObject);
200
- case 15:
211
+ case 21:
201
212
  resultObject = _context2.sent;
202
213
  this.setSaveResult(resultObject, "auto");
203
214
  if (!this.__saveResultIsSuccess) {
204
215
  console.error("bad save result : ", resultObject);
205
216
  WebObject.addError(this, "Save result is not valid", "the response from server was not a valid saveresult object !", true);
206
217
  }
207
- _context2.next = 21;
218
+ _context2.next = 27;
208
219
  break;
209
- case 20:
220
+ case 26:
210
221
  /* nothing to save */
211
222
  this.setSaveResult(null, "nothing");
212
- case 21:
223
+ case 27:
213
224
  if (!this.isSaved) {
214
- _context2.next = 25;
225
+ _context2.next = 31;
215
226
  break;
216
227
  }
217
- _context2.next = 24;
228
+ _context2.next = 30;
218
229
  return this.onSave();
219
- case 24:
230
+ case 30:
220
231
  return _context2.abrupt("return", this.getSaveResult());
221
- case 25:
232
+ case 31:
233
+ _context2.prev = 31;
234
+ if (!this.manager) {
235
+ _context2.next = 37;
236
+ break;
237
+ }
238
+ _context2.next = 35;
239
+ return this.manager.setOption("saving", false);
240
+ case 35:
241
+ _context2.next = 37;
242
+ return this.manager.setOption("loading", false);
243
+ case 37:
244
+ return _context2.finish(31);
245
+ case 38:
222
246
  case "end":
223
247
  return _context2.stop();
224
248
  }
225
- }, _callee2, this);
249
+ }, _callee2, this, [[0,, 31, 38]]);
226
250
  }));
227
251
  function Save() {
228
252
  return _Save.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.4.163",
3
+ "version": "1.4.165",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",
@@ -70,11 +70,11 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@azrico/convert": "^1.0.5",
73
- "@azrico/event": "^1.2.43",
74
- "@azrico/global": "^1.3.78",
73
+ "@azrico/event": "^1.2.44",
74
+ "@azrico/global": "^1.3.79",
75
75
  "@azrico/math": "^1.0.5",
76
- "@azrico/object": "^1.4.101",
77
- "@azrico/string": "^1.2.95",
76
+ "@azrico/object": "^1.4.107",
77
+ "@azrico/string": "^1.2.102",
78
78
  "@azrico/types": "^1.0.9",
79
79
  "@azrico/uid": "^1.0.8"
80
80
  },