vue_crud 0.1.6 → 0.1.7

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: 313968e07fdf547c43ef08160318401f2b9e5c95
4
- data.tar.gz: bba0750f4d48ff9a7053648b911f86b9e7c82411
3
+ metadata.gz: 9f876c6d554cc8a8d7a13f77570930db1c099d71
4
+ data.tar.gz: a87dac499a723925956eeb3a384c4722f62bbef2
5
5
  SHA512:
6
- metadata.gz: b94af9b043bb54f1e8bb01519cf0c0d04b90f29e057cb54633fef0a556be2055a776d96622a8f720bfdb81895df1609aaf43d5adeda4c0f3d5632b63c6a0612e
7
- data.tar.gz: f7b146aa0640e37ad84c591bc7c098396193b6930cef2bbd18e5c7986fb3bb926e6a51e4aecf3ac7e7c73ac8f2294cc40bb0272d668d83cc10762d9a35e08b4d
6
+ metadata.gz: c18e5f2ce378820e6cc94c11ed8b5d3905178b7615aba90a3e1e482cc8cf3a6fbc91838b84b2b41c8dcc2726c5d8b70f4a1894543d194ea27d89304cd11e71c5
7
+ data.tar.gz: 5a463b0a49d63bea07ec5b074b777eac1596991f2755112724184b73d786ca9ec7807614fe4b5eb1ea04ae7e07798e495424877d49702511b59f23dbbe64eae1
@@ -1,3 +1,3 @@
1
1
  module VueCrud
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
@@ -88,19 +88,30 @@ function vue_init(params = {}) {
88
88
  event_hub.$on('update_progress', function(progress) {
89
89
  this.progress = progress;
90
90
  }.bind(this));
91
-
92
91
  event_hub.$on('cancel_customMode', function() {
93
92
  this.customMode = false;
94
93
  }.bind(this));
94
+ event_hub.$on('toggle_modal_open', function() {
95
+ this.onModalOpen();
96
+ }.bind(this));
97
+ event_hub.$on('toggle_modal_close', function() {
98
+ this.onModalClose();
99
+ }.bind(this));
95
100
  },
96
101
  methods: {
102
+ onModalOpen: function() {
103
+
104
+ },
105
+ onModalClose: function() {
106
+
107
+ },
97
108
  deleteModel: function () {
98
109
  var that = this;
99
110
  that.deleteMode = true;
100
111
  if(confirm("Are you sure?") == true) {
101
112
  $.ajax({
102
113
  method: 'DELETE',
103
- url: that.info.url_prefix + '/' + that.model.id + options.suffix,
114
+ url: that.info.url_prefix + '/' + that.model.id + options.suffix + location.search,
104
115
  success: function(res) {
105
116
  $(that.$el).remove();
106
117
  },
@@ -121,7 +132,7 @@ function vue_init(params = {}) {
121
132
  data: {
122
133
  model: that.model,
123
134
  },
124
- url: that.info.url_prefix + '/' + that.model.id + options.suffix,
135
+ url: that.info.url_prefix + '/' + that.model.id + options.suffix + location.search,
125
136
  beforeSend: function() {
126
137
  modal.find('.dimmer').toggleClass('active');
127
138
  $('.progress-bar').css('width', '0');
@@ -177,8 +188,9 @@ function vue_init(params = {}) {
177
188
  success: function(res) {
178
189
  that.info = res;
179
190
  that.model = obj_to_json(that.info.structure);
191
+
180
192
  $.ajax({
181
- url: that.info.url_prefix + options.suffix,
193
+ url: that.info.url_prefix + options.suffix + location.search,
182
194
  success: function(res) {
183
195
  that.models = res;
184
196
  }
@@ -188,6 +200,12 @@ function vue_init(params = {}) {
188
200
  event_hub.$on('update_progress', function(progress) {
189
201
  this.progress = progress;
190
202
  }.bind(this));
203
+ event_hub.$on('toggle_modal_open', function() {
204
+ this.onModalOpen();
205
+ }.bind(this));
206
+ event_hub.$on('toggle_modal_close', function() {
207
+ this.onModalClose();
208
+ }.bind(this));
191
209
  $('#form-progress').change(function(){
192
210
  event_hub.$emit('update_progress', $(this).val());
193
211
  });
@@ -250,6 +268,12 @@ function vue_init(params = {}) {
250
268
  }
251
269
  },
252
270
  methods: {
271
+ onModalOpen: function() {
272
+
273
+ },
274
+ onModalClose: function() {
275
+
276
+ },
253
277
  setPage: function(idx){
254
278
  if( idx <= 0 || idx > this.totalPage ){
255
279
  return;
@@ -264,7 +288,7 @@ function vue_init(params = {}) {
264
288
  data: {
265
289
  model: that.model,
266
290
  },
267
- url: that.info.url_prefix + options.suffix,
291
+ url: that.info.url_prefix + options.suffix + location.search,
268
292
  before: function() {
269
293
  $('.new_modal').find('.dimmer').toggleClass('active');
270
294
  $('.progress-bar').css('width', '0');
@@ -295,10 +319,11 @@ $(document).ready(function() {
295
319
  onShow: function() {
296
320
  $(this).find('select.ui.dropdown').dropdown();
297
321
  $(this).find('.ui.checkbox').checkbox();
298
-
322
+ event_hub.$emit('toggle_modal_open');
299
323
  },
300
324
  onHide: function() {
301
325
  event_hub.$emit('cancel_customMode');
326
+ event_hub.$emit('toggle_modal_close');
302
327
  }
303
328
  }).modal('show');
304
329
  });
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vue_crud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donald Chiang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-08 00:00:00.000000000 Z
11
+ date: 2016-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -79,6 +79,7 @@ files:
79
79
  - vendor/assets/javascripts/vue_crud.js
80
80
  - vendor/assets/stylesheets/vue_crud.css
81
81
  - vue_crud-0.1.5.gem
82
+ - vue_crud-0.1.6.gem
82
83
  - vue_crud.gemspec
83
84
  homepage: http://www.mynet.com.tw
84
85
  licenses: