thin_man 0.15.5 → 0.15.6

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: 82d0037fd57782f093c2f8c40bb85ecdf042319c
4
- data.tar.gz: d33cd2002c5a9fabd9f5746f04ae462454b7f3ba
3
+ metadata.gz: 373fee9d1af3e08f436b8c8c523d74548fe72220
4
+ data.tar.gz: fb31a388438fb06ca08041272ce0176785d51305
5
5
  SHA512:
6
- metadata.gz: dad95ff0c38f7074ad65706f4dcf68bffdd7efd0bdaec409c6a357478f06e51ed595a914d72376acb48325ea11d7fda72ad69d1bef726ecabd74976f749193d1
7
- data.tar.gz: 1da6dcb4bb4823011ae6499fecb7a163f4219a466692a5d0e76711a063570c06bbaf78dfc1d82e00e4f745865c0bedcd87f8e60d1984031737a917fd58d78c51
6
+ metadata.gz: f5d5b86b4e62db5b314253783b219b29f76ae081544c6baa424f804680a954a4fed63f1bc58d9f785cae205dcf8cf1bb1c252c54eefc4404928f9f5355d180e3
7
+ data.tar.gz: c78d106d8b01b32d333332064baaa713e3094505f0058eadf3aa5f43c030bd536eeaca853202c75bab3e8af6289ffc848fce3fd04fe6b94a777ad4a63d4d6038
@@ -374,13 +374,26 @@ var initThinMan = function(){
374
374
  return this.jq_obj.attr('method') || 'POST'
375
375
  },
376
376
  getData: function(){
377
+ var $clicked = $(document.activeElement);
378
+
379
+ if ($clicked.length && $clicked.is('button[type="submit"], input[type="submit"], input[type="image"]') && $clicked.is('[name]')) {
380
+ var button_name = $clicked.attr('name')
381
+ var button_value = $clicked.attr('value')
382
+ }
377
383
  if(this.getAjaxType().toLowerCase() == 'get'){
378
384
  var data_array = this.jq_obj.serializeArray();
385
+ if(button_name && button_value){
386
+ data_array.push({name: button_name, value: button_value})
387
+ }
379
388
  return data_array;
380
389
  }else{
381
390
  // need to implement a data-attribute for multiple file fields so we can allow selecting mutliple files at once. example here:
382
391
  // http://stackoverflow.com/questions/12989442/uploading-multiple-files-using-formdata
383
- return new FormData(this.jq_obj[0]);
392
+ var fd = new FormData(this.jq_obj[0]);
393
+ if(button_name && button_value){
394
+ fd.set(button_name, button_value)
395
+ }
396
+ return fd
384
397
  }
385
398
  },
386
399
  ajaxSuccess: function(data,textStatus,jqXHR){
@@ -1,3 +1,3 @@
1
1
  module ThinMan
2
- VERSION = "0.15.5"
2
+ VERSION = "0.15.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thin_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.5
4
+ version: 0.15.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut, Adam Bialek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-03 00:00:00.000000000 Z
11
+ date: 2016-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails