oxymoron 1.1.1 → 1.1.2

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: d2896c721c93c1e0f51233956ea918098f00e29f
4
- data.tar.gz: bfd97ec5177533822dbd45630e30b56fbcfd6df5
3
+ metadata.gz: b02bfa78a550b6bf3e67c6c037fc2d6f4a1441d1
4
+ data.tar.gz: f8410c0f968c642b5d7c22ad5588bf1d2aeb29ee
5
5
  SHA512:
6
- metadata.gz: a1742ff413995131bac75b9fbc96092d87dec34b34c2547b1add41baf04228de23b7c5b6d060b59bfbac6544796a4e703627a757314d19ffd10a4bb3c04768d1
7
- data.tar.gz: 1ed845272cc3e4b8d90e8eb1b40c2df68527043d247a2284325ee43480c6867f3b19e719a98ab7b8d668d7992c701f49f59ff6571838fa40702e88da431960a9
6
+ metadata.gz: eb2030dec4f13be94eb5ae97a429fd9e99301b76f42fba806c3655251baca1678f1cfb20a6a76cfc90422cc07935690389902fd0a34b0dea7e87dccb1900b9d8
7
+ data.tar.gz: 6615dc250f1573cecffd31bb70814f51b352956d03b8f01c3bf9cb813eb2be2c97e4d3bb13620ef0f14c316a28fdbbe12720a7a57e8c9c0f51221be1b76555db
@@ -12,15 +12,17 @@ angular.module("oxymoron.directives.fileupload", [])
12
12
  $scope.percentCompleted = undefined;
13
13
 
14
14
  element.bind('change', function(){
15
+ if ($scope.xhr) $scope.xhr.abort();
16
+
15
17
  var fd = new FormData();
16
18
 
17
19
  angular.forEach(element[0].files, function (file) {
18
20
  fd.append("attachments[]", file);
19
21
  })
20
22
 
21
- var xhr = new XMLHttpRequest;
23
+ $scope.xhr = new XMLHttpRequest;
22
24
 
23
- xhr.upload.onprogress = function(e) {
25
+ $scope.xhr.upload.onprogress = function(e) {
24
26
  // Event listener for when the file is uploading
25
27
  $scope.$apply(function() {
26
28
  var percentCompleted;
@@ -30,7 +32,7 @@ angular.module("oxymoron.directives.fileupload", [])
30
32
  });
31
33
  };
32
34
 
33
- xhr.onload = function() {
35
+ $scope.xhr.onload = function() {
34
36
  var res = JSON.parse(this.responseText)
35
37
 
36
38
  $scope.$apply(function() {
@@ -58,9 +60,10 @@ angular.module("oxymoron.directives.fileupload", [])
58
60
  };
59
61
 
60
62
 
61
- xhr.open('POST', $scope.fileupload);
62
- xhr.setRequestHeader('X-XSRF-Token', $cookies.get('XSRF-TOKEN'));
63
- xhr.send(fd);
63
+ $scope.xhr.open('POST', $scope.fileupload);
64
+ $scope.xhr.setRequestHeader('X-XSRF-Token', $cookies.get('XSRF-TOKEN'));
65
+ $scope.xhr.send(fd);
66
+
64
67
  element[0].value = '';
65
68
  })
66
69
  }
@@ -1,3 +1,3 @@
1
1
  module Oxymoron
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oxymoron
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kononenko Paul
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-27 00:00:00.000000000 Z
11
+ date: 2016-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print