vue_crud 0.1.10.8.3 → 0.1.10.8.4

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: f23422603c2de4a79d19d63765cb0243d6bd918d
4
- data.tar.gz: f0e093a5e21a57b75a4d6b3a4e3af187cf7f3448
3
+ metadata.gz: 3a6f10558670ce63c2f3f96aab78e2744935634f
4
+ data.tar.gz: 80dad7fa336ce0ee56afa6135af6eba2c69d0695
5
5
  SHA512:
6
- metadata.gz: 0476af27959e5248c3c54ffb1eee2d557071392c0976221939b629622a1b9cc289e44cf8e8ff3de6acf25fa7a6be5ecbf82414c35bf4be20bc029d3e440f5374
7
- data.tar.gz: b03650b87f112cb25c019a042f3045e8312f2ab225d3b83f025b13cb00424bcc490e96c12fafbb3ff40ba35892dfba3326c5ac7f9b735ad5f786856539842061
6
+ metadata.gz: 588ccb12ea0d9c0764779a5561f68f2f17c08fe5cd931d8a0973c8bf61cfb6df35a53ee423e95d293a37ee1a152c75559ccbdc08aef1c6bd2c755b01eec7fffe
7
+ data.tar.gz: 4f8390d1ab6cf4cf0123ffa1d05a06b17d95ada8419f315b4246026f8e5aa4e9ffc70a8caa8d453d5c8b3565efe7f563620c1073c899ab55ebbe47687bddbd43
@@ -1,3 +1,3 @@
1
1
  module VueCrud
2
- VERSION = "0.1.10.8.3"
2
+ VERSION = "0.1.10.8.4"
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(error) {
120
- this.error = error;
119
+ event_hub.$on('update_error', function(errors) {
120
+ this.errors = errors;
121
121
  }.bind(this));
122
122
  event_hub.$on('update_action_name', function(action_name) {
123
123
  this.action_name = action_name;
@@ -177,13 +177,14 @@ function vueCRUD_init(params = {}) {
177
177
  observeChanges: true,
178
178
  transition: 'fade down',
179
179
  onShow: function() {
180
- // $('.needRefresh').froalaEditor('reset');
180
+ that.errors = {};
181
+ $('.needRefresh').froalaEditor('reset');
181
182
  $(this).find('select.ui.dropdown').dropdown();
182
183
  $(this).find('.ui.checkbox').checkbox();
183
184
  if(typeof modalOpen !== "undefined") modalOpen(this);
184
185
  },
185
186
  onVisible: function() {
186
- // $('.needRefresh').froalaEditor('refresh');
187
+ $('.needRefresh').froalaEditor('refresh');
187
188
  },
188
189
  onHide: function() {
189
190
  event_hub.$emit('cancel_customMode');
@@ -263,11 +264,11 @@ function vueCRUD_init(params = {}) {
263
264
  }.bind(this));
264
265
  event_hub.$emit('openModal');
265
266
  },
266
- restoreModel: function () {
267
+ restoreModel: function() {
267
268
  var that = this;
268
269
  $.ajax({
269
270
  method: 'POST',
270
- data: JSON.stringify(that.model),
271
+ data: obj_to_json(that.model),
271
272
  url: that.info.url_prefix + options.suffix + location.search,
272
273
  success: function(res) {
273
274
  that.model = res;
@@ -296,10 +297,11 @@ function vueCRUD_init(params = {}) {
296
297
  deleteModel: function () {
297
298
  var that = this;
298
299
  that.deleteMode = true;
300
+ var id = that.model.ID || that.model.id;
299
301
  if(confirm("Are you sure?") == true) {
300
302
  $.ajax({
301
303
  method: 'DELETE',
302
- url: that.info.url_prefix + '/' + that.model.ID + options.suffix + location.search,
304
+ url: that.info.url_prefix + '/' + id + options.suffix + location.search,
303
305
  success: function(res) {
304
306
  that.is_deleted = true;
305
307
  // event_hub.$on('toggleRestoreSuccess', function() {
@@ -327,12 +329,12 @@ function vueCRUD_init(params = {}) {
327
329
  },
328
330
  updateModel: function() {
329
331
  var that = this;
332
+ var id = that.model.ID || that.model.id;
330
333
  $.ajax({
331
334
  method: 'PATCH',
332
- data: JSON.stringify(that.model),
333
- url: that.info.url_prefix + '/' + that.model.ID + options.suffix + location.search,
335
+ data: obj_to_json(that.model),
336
+ url: that.info.url_prefix + '/' + id + options.suffix + location.search,
334
337
  beforeSend: function() {
335
- console.log(JSON.stringify(that.model));
336
338
  event_hub.$emit('dimmerOn');
337
339
  $('.progress-bar').css('width', '0');
338
340
  },
@@ -487,7 +489,7 @@ function vueCRUD_init(params = {}) {
487
489
  // var that = this;
488
490
  // $.ajax({
489
491
  // method: 'POST',
490
- // data: JSON.stringify(that.model),
492
+ // data: obj_to_json(that.model),
491
493
  // url: that.info.url_prefix + options.suffix + location.search,
492
494
  // success: function(res) {
493
495
  // event_hub.$emit('toggleRestoreSuccess');
@@ -501,10 +503,10 @@ function vueCRUD_init(params = {}) {
501
503
  var that = this;
502
504
  $.ajax({
503
505
  method: 'POST',
504
- data: JSON.stringify(that.model),
506
+ data: obj_to_json(that.model),
505
507
  url: that.info.url_prefix + options.suffix + location.search,
506
508
  beforeSend: function() {
507
- console.log(JSON.stringify(that.model));
509
+ console.log(obj_to_json(that.model));
508
510
  event_hub.$emit('dimmerOn');
509
511
  $('.progress-bar').css('width', '0');
510
512
  },
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.3
4
+ version: 0.1.10.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donald Chiang