polymer-rails-forms 0.1.13 → 0.1.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2fa8b0c6a144b84346b5a6a3f187e2b5465257d
4
- data.tar.gz: c8801d3c7ff77b0820c3f42fd18948144e2a022a
3
+ metadata.gz: 99e7b1677ddc0f20f5fd3b099d441374ef2026e7
4
+ data.tar.gz: 70aa1538f6ff43a9f410aee9234ac5f2f39825d8
5
5
  SHA512:
6
- metadata.gz: db95e62a5c0f3882e599ba01a3f135c601bb8d2d051b238ad0ad7d658c929ded46a519b182a0a4d432b2307d8a78cdf81bf0d82ef425fcb30479b63e8b006565
7
- data.tar.gz: a9421fdf17b6b0ddefbf6aa292c7e85eed6f8c6f6cd79295a7422320f5537d2e78993db5ea4f4acaf1e84c9ceddee6d025d41ae9ea34d6010e4eefeb4452815b
6
+ metadata.gz: 1e31bb104ede0d50094ccf06a6967b2a4f66b320f7556881a984d4f2d0c9224aad51ecbb135626d965a4c996dcac7a5c75dc40a72104ccee02473dd164371376
7
+ data.tar.gz: 50e87d98b438f12bb271feab02ad8a95cd1b75a015ce99f0fa1c2c5c5c8596464d14e11e1f8da254bcc08f544e6d89d96a8099035f3624f6fd44690d9f57dcad
@@ -635,8 +635,8 @@
635
635
  },
636
636
 
637
637
  appendInputs: function(){
638
- for (var i=0; i<this.inputList.length; i++){
639
- var obj = this.inputList[i],
638
+ while (this.inputList.length){
639
+ var obj = this.inputList.shift(),
640
640
  container = this.shadowRoot.querySelector(obj.container);
641
641
 
642
642
  //TODO: insert points
@@ -252,12 +252,25 @@
252
252
 
253
253
  domReady: function(){
254
254
  var form = this.shadowRoot.querySelector("form"),
255
- button = this.shadowRoot.querySelector("paper-button");
255
+ button = this.shadowRoot.querySelector("#submit-button");
256
256
 
257
257
  button.addEventListener("click", function(e){
258
258
  if (this.action !== null){
259
259
  if (this.xhr){
260
- this.$.xhr.request({ method: this.method, url: this.action, params: this.data, callback: this.handleXhrCallback })
260
+ if (!!this.scope && this.scope.length > 0){
261
+ var data = {};
262
+ data[this.scope] = this.data;
263
+ } else {
264
+ data = this.data;
265
+ }
266
+
267
+ this.$.xhr.request({
268
+ method: this.method,
269
+ url: this.action,
270
+ body: JSON.stringify(data),
271
+ callback: this.handleXhrCallback,
272
+ headers: { "Content-type": "application/json", "Accept": "application/json" }
273
+ })
261
274
  } else {
262
275
  form.submit();
263
276
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polymer-rails-forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Weber
@@ -42,7 +42,7 @@ files:
42
42
  - lib/polymer-rails-forms.rb
43
43
  - lib/polymer_rails_forms/railtie.rb
44
44
  - lib/tasks/install.rake
45
- homepage: https://github.com/gearcommons/polymer-rails-forms
45
+ homepage: https://gihub.com/gearcommons/polymer-rails-forms
46
46
  licenses:
47
47
  - MIT
48
48
  metadata: {}