dynamic_scaffold 0.8.0 → 0.8.1

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
  SHA256:
3
- metadata.gz: 74a0f8f30faba7f43c94890c5e27a9dbdfe411fc1c0251f64aae80adbf04e47a
4
- data.tar.gz: 41b6ef7eb1339343dbedead999fa2977036388c541633efd59827929cafc9227
3
+ metadata.gz: 2d38fc22e5839b2a4f2fda31b49b33750e787500a6d031d19e713bef0cf77019
4
+ data.tar.gz: 5a40a274745f8f9f39e8928f5aa0063c188142a9b714593137e5b0a75d3ad09c
5
5
  SHA512:
6
- metadata.gz: 508a0b9f5cbc4d006db7e3ab9748034c96d9ab7bd377aed9ae052f5b323980eff1106a2ff2afb463fe6389a6939a6747b35360a0979c0959f2dc00b4ffa26ff3
7
- data.tar.gz: 80cfaac150327d5251cffbe01d7add2ae92d8c4e354f46f1793d26b5b6b99b223019a2ca7e940d47d749310ef82b6b7edd36488bf4479d0c56b5923fd8cb3ab9
6
+ metadata.gz: 5a1bb89adddf8b3ad91d241cac6090f3e6bc9b8a58f6a2160f9f546529a62763451acf61230ebf0abfd166b4527dc6427ae3c659578b8035e2ff220704d1bba3
7
+ data.tar.gz: 152ed6d4b6bacce23dd7eb49619211796bb6cc12b885677a59789714477028717b63deb74a9582911e5c695c36714c1f57f2cd7b4a23bcaba38d44b81386ad2e
@@ -29,16 +29,18 @@ document.addEventListener('dynamic_scaffold:load', function (){
29
29
  }
30
30
 
31
31
  // change event
32
+ var cropper = undefined
32
33
  input.addEventListener('change', function(e){
33
34
  const reader = new FileReader();
34
35
  reader.onload = function (e) {
36
+ if(cropper) cropper.destroy()
35
37
  img.src = e.target.result
36
38
  if(cropper_input){
37
39
  const options = JSON.parse(cropper_input.getAttribute('data-options'))
38
40
  options.crop = function(event){
39
41
  cropper_input.value = JSON.stringify(event.detail)
40
42
  }
41
- const cropper = new Cropper(img, options)
43
+ cropper = new Cropper(img, options)
42
44
  }
43
45
 
44
46
  preview.style.display = 'inline-block'
@@ -1,3 +1,3 @@
1
1
  module DynamicScaffold
2
- VERSION = '0.8.0'.freeze
2
+ VERSION = '0.8.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masamoto Miyata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-24 00:00:00.000000000 Z
11
+ date: 2018-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: classnames-rails-view