vue_crud 0.1.10.8.2 → 0.1.10.8.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d97a3b73c315fef985c78e9f9e6d83a4b051a08
4
- data.tar.gz: e1afbcba32bae987e929b7a0554f31b062cb8330
3
+ metadata.gz: f23422603c2de4a79d19d63765cb0243d6bd918d
4
+ data.tar.gz: f0e093a5e21a57b75a4d6b3a4e3af187cf7f3448
5
5
  SHA512:
6
- metadata.gz: ba8d4e5708461e9f1e82ff6521f042a157faa64f15eb03547b22a678d66e30a5ca98d8796ab62ac9783a2402a4d285f48578f59222066b955290447e4120e396
7
- data.tar.gz: fda38526ca19fd9d4b763e6de1f34f796e3d5e9fdfd4d40c19162812ec19adbc9fcd527c1130d00d2676204bf6f843bd389080d5f29f506bf23f67d9c4011184
6
+ metadata.gz: 0476af27959e5248c3c54ffb1eee2d557071392c0976221939b629622a1b9cc289e44cf8e8ff3de6acf25fa7a6be5ecbf82414c35bf4be20bc029d3e440f5374
7
+ data.tar.gz: b03650b87f112cb25c019a042f3045e8312f2ab225d3b83f025b13cb00424bcc490e96c12fafbb3ff40ba35892dfba3326c5ac7f9b735ad5f786856539842061
@@ -1,3 +1,3 @@
1
1
  module VueCrud
2
- VERSION = "0.1.10.8.2"
2
+ VERSION = "0.1.10.8.3"
3
3
  end
@@ -116,8 +116,8 @@ function vueCRUD_init(params = {}) {
116
116
  }
117
117
  },
118
118
  mounted: function() {
119
- event_hub.$on('update_error', function(errors) {
120
- this.errors = errors;
119
+ event_hub.$on('update_error', function(error) {
120
+ this.error = error;
121
121
  }.bind(this));
122
122
  event_hub.$on('update_action_name', function(action_name) {
123
123
  this.action_name = action_name;
@@ -177,14 +177,13 @@ function vueCRUD_init(params = {}) {
177
177
  observeChanges: true,
178
178
  transition: 'fade down',
179
179
  onShow: function() {
180
- that.errors = {};
181
- $('.needRefresh').froalaEditor('reset');
180
+ // $('.needRefresh').froalaEditor('reset');
182
181
  $(this).find('select.ui.dropdown').dropdown();
183
182
  $(this).find('.ui.checkbox').checkbox();
184
183
  if(typeof modalOpen !== "undefined") modalOpen(this);
185
184
  },
186
185
  onVisible: function() {
187
- $('.needRefresh').froalaEditor('refresh');
186
+ // $('.needRefresh').froalaEditor('refresh');
188
187
  },
189
188
  onHide: function() {
190
189
  event_hub.$emit('cancel_customMode');
@@ -264,26 +263,28 @@ function vueCRUD_init(params = {}) {
264
263
  }.bind(this));
265
264
  event_hub.$emit('openModal');
266
265
  },
267
- var that = this;
268
- $.ajax({
269
- method: 'POST',
270
- data: obj_to_json(that.model),
271
- url: that.info.url_prefix + options.suffix + location.search,
272
- success: function(res) {
273
- that.model = res;
274
- that.deleteMode = false;
275
- that.is_deleted = false;
276
- that.is_success = true;
277
- sleep(1500).then(() => {
278
- that.is_success = false;
279
- });
280
- },
281
- error: function(res) {
282
- that.is_deleted = false;
283
- that.is_restore_failed = true;
284
- alert('復原失敗,請記錄資料並重新建立');
285
- }
286
- });
266
+ restoreModel: function () {
267
+ var that = this;
268
+ $.ajax({
269
+ method: 'POST',
270
+ data: JSON.stringify(that.model),
271
+ url: that.info.url_prefix + options.suffix + location.search,
272
+ success: function(res) {
273
+ that.model = res;
274
+ that.deleteMode = false;
275
+ that.is_deleted = false;
276
+ that.is_success = true;
277
+ sleep(1500).then(() => {
278
+ that.is_success = false;
279
+ });
280
+ },
281
+ error: function(res) {
282
+ that.is_deleted = false;
283
+ that.is_restore_failed = true;
284
+ alert('復原失敗,請記錄資料並重新建立');
285
+ }
286
+ });
287
+ },
287
288
  // restoreModel: function() {
288
289
  // if(confirm("Are you sure?") == true) {
289
290
  // event_hub.$emit('restoreCreate', this.model);
@@ -295,12 +296,10 @@ function vueCRUD_init(params = {}) {
295
296
  deleteModel: function () {
296
297
  var that = this;
297
298
  that.deleteMode = true;
298
- var id = that.model.ID || that.model.id;
299
-
300
299
  if(confirm("Are you sure?") == true) {
301
300
  $.ajax({
302
301
  method: 'DELETE',
303
- url: that.info.url_prefix + '/' + id + options.suffix + location.search,
302
+ url: that.info.url_prefix + '/' + that.model.ID + options.suffix + location.search,
304
303
  success: function(res) {
305
304
  that.is_deleted = true;
306
305
  // event_hub.$on('toggleRestoreSuccess', function() {
@@ -328,12 +327,12 @@ function vueCRUD_init(params = {}) {
328
327
  },
329
328
  updateModel: function() {
330
329
  var that = this;
331
- var id = that.model.ID || that.model.id;
332
330
  $.ajax({
333
331
  method: 'PATCH',
334
- data: obj_to_json(that.model),
335
- url: that.info.url_prefix + '/' + id + options.suffix + location.search,
332
+ data: JSON.stringify(that.model),
333
+ url: that.info.url_prefix + '/' + that.model.ID + options.suffix + location.search,
336
334
  beforeSend: function() {
335
+ console.log(JSON.stringify(that.model));
337
336
  event_hub.$emit('dimmerOn');
338
337
  $('.progress-bar').css('width', '0');
339
338
  },
@@ -488,7 +487,7 @@ function vueCRUD_init(params = {}) {
488
487
  // var that = this;
489
488
  // $.ajax({
490
489
  // method: 'POST',
491
- // data: obj_to_json(that.model),
490
+ // data: JSON.stringify(that.model),
492
491
  // url: that.info.url_prefix + options.suffix + location.search,
493
492
  // success: function(res) {
494
493
  // event_hub.$emit('toggleRestoreSuccess');
@@ -502,10 +501,10 @@ function vueCRUD_init(params = {}) {
502
501
  var that = this;
503
502
  $.ajax({
504
503
  method: 'POST',
505
- data: obj_to_json(that.model),
504
+ data: JSON.stringify(that.model),
506
505
  url: that.info.url_prefix + options.suffix + location.search,
507
506
  beforeSend: function() {
508
- console.log(obj_to_json(that.model));
507
+ console.log(JSON.stringify(that.model));
509
508
  event_hub.$emit('dimmerOn');
510
509
  $('.progress-bar').css('width', '0');
511
510
  },
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vue_crud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10.8.2
4
+ version: 0.1.10.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donald Chiang