vue_crud 0.1.10.8.3 → 0.1.10.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vue_crud/version.rb +1 -1
- data/vendor/assets/javascripts/vue_crud.js +15 -13
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a6f10558670ce63c2f3f96aab78e2744935634f
|
4
|
+
data.tar.gz: 80dad7fa336ce0ee56afa6135af6eba2c69d0695
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 588ccb12ea0d9c0764779a5561f68f2f17c08fe5cd931d8a0973c8bf61cfb6df35a53ee423e95d293a37ee1a152c75559ccbdc08aef1c6bd2c755b01eec7fffe
|
7
|
+
data.tar.gz: 4f8390d1ab6cf4cf0123ffa1d05a06b17d95ada8419f315b4246026f8e5aa4e9ffc70a8caa8d453d5c8b3565efe7f563620c1073c899ab55ebbe47687bddbd43
|
data/lib/vue_crud/version.rb
CHANGED
@@ -116,8 +116,8 @@ function vueCRUD_init(params = {}) {
|
|
116
116
|
}
|
117
117
|
},
|
118
118
|
mounted: function() {
|
119
|
-
event_hub.$on('update_error', function(
|
120
|
-
this.
|
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
|
-
|
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
|
-
|
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:
|
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 + '/' +
|
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:
|
333
|
-
url: that.info.url_prefix + '/' +
|
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:
|
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:
|
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(
|
509
|
+
console.log(obj_to_json(that.model));
|
508
510
|
event_hub.$emit('dimmerOn');
|
509
511
|
$('.progress-bar').css('width', '0');
|
510
512
|
},
|