instant-upload 1.0.0 → 1.0.1

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: a915090983c7f4573bd6e86b6520aee02278b6e3
4
- data.tar.gz: 4a490ad63b4c0c95748a95170bc202f0f7f2dcb6
3
+ metadata.gz: fb18a57e70d32fd4b6db8bf9281824b3ac175f48
4
+ data.tar.gz: fc48b0cb853665c468c44a257b0028232cf97b32
5
5
  SHA512:
6
- metadata.gz: a6f78cee8626762d7476da582ab46a9469efd73e6f48a6fe59fa2e700f45d3a969a991fc080b501565044431026ccf006c09127d5709e925aebe5d5531bdd5d6
7
- data.tar.gz: 48166a87eeabc58e568db4aae8bf6ff7dcb10fd7c9215ec36c7c3fda380f6f0241c90d4ed6de56071d24aa357b481b3a809c17134d43b77b31806ae71b40c5e3
6
+ metadata.gz: fef52262fd073bf7e1de3cdb728ddc8a4a572eb0165c56035ded1f66bb86d2dd581eca548276b96db8358f4c1b1fae05f7528dc88cc18e2a1cff811dfa6f55b1
7
+ data.tar.gz: a9b361b5dba39e83cd82136500e35e76f745e8ac9d8b75e8887312ebc5b2a38ad5c8f6bd3779c92600fcb05c200603a83adeab4812825d385376fd921db7c539
@@ -109,7 +109,13 @@ app = angular.module('instantUpload', [])
109
109
 
110
110
  # $scope.files = []
111
111
  for image in $.parseJSON(xhr.response)
112
- $scope.files.push { path: image[$scope.multi][$scope.version].url }
112
+ isNew = true
113
+
114
+ if $scope.persisted
115
+ for f in $scope.files
116
+ isNew = false if f.id == image.id
117
+
118
+ $scope.files.push { path: image[$scope.multi][$scope.version].url, id: image.id } if isNew
113
119
  ), false
114
120
 
115
121
  xhr.addEventListener 'error', ( (e) =>
@@ -142,7 +148,8 @@ app = angular.module('instantUpload', [])
142
148
 
143
149
  $scope.$apply ->
144
150
  $uploader.find('.iu-multi-files-cache li').each ->
145
- $scope.files.push { path: $(this).find('img').attr('src') }
151
+ $this = $(this)
152
+ $scope.files.push { path: $this.find('img').attr('src'), id: $this.data('id') }
146
153
 
147
154
  $ -> $scope.init($($element)) if !!window.FormData
148
155
 
@@ -9,7 +9,7 @@
9
9
 
10
10
  %ul.iu-multi-files-cache
11
11
  - record.send(field).each do |img|
12
- %li= image_tag img.send(options[:multi]).send(options[:version]).url
12
+ %li{ data: { id: img.id } }= image_tag img.send(options[:multi]).send(options[:version]).url
13
13
 
14
14
  .iu-alert Too much, only #{options[:limit]}
15
15
 
@@ -1,3 +1,3 @@
1
1
  module InstantUpload
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instant-upload
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mariusz Ołownia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-15 00:00:00.000000000 Z
11
+ date: 2013-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails