Skip to content

Commit

Permalink
Fix getChosenFile not returning drag&drop file
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanziyang committed Mar 25, 2018
1 parent 3e11f4a commit 0e6eadb
Show file tree
Hide file tree
Showing 3 changed files with 1,059 additions and 1,049 deletions.
15 changes: 8 additions & 7 deletions docs/simple-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@
<body>
<div id="app">
<h1>Vue-Croppa Simple Test</h1>
<croppa style="width: 100%; height: 300px" auto-sizing replace-drop ref="myCroppa" v-model="croppa" :width="width" :height="height"
@initial-image-loaded="onInitialLoaded" :input-attrs="{ capture: true, class: 'file-input' }" initial-position="50% 50%"
initial-size="cover" @init="onInit" @move="onMove" @zoom="onZoom" @draw="onDraw" @new-image-drawn="onNewImageDrawn" @loading-start="onLoadingStart"
@loading-end="onLoadingEnd" :placeholder="croppa && croppa.loading ? '' : 'Choose A File'" :initial-image="initialImage"
:prevent-white-space="preventWhiteSpace" show-loading :image-border-radius="borderRadius">
<croppa replace-drop ref="myCroppa" v-model="croppa" :width="width" :height="height" @initial-image-loaded="onInitialLoaded"
:input-attrs="{ capture: true, class: 'file-input' }" initial-position="50% 50%" initial-size="cover" @init="onInit"
@move="onMove" @zoom="onZoom" @draw="onDraw" @new-image-drawn="onNewImageDrawn" @loading-start="onLoadingStart" @loading-end="onLoadingEnd"
:placeholder="croppa && croppa.loading ? '' : 'Choose A File'" :initial-image="initialImage" :prevent-white-space="preventWhiteSpace"
show-loading :image-border-radius="borderRadius">
<img slot="placeholder" src="static/favicons/android-chrome-512x512.png" class="addon">
<!-- <img slot="initial" crossOrigin="anonymous" src="https://raw.githubusercontent.com/recurser/exif-orientation-examples/master/Portrait_6.jpg"
ref="foo" class="external" data-exif-orientation="6"> -->
<div class="spinner" v-if="croppa && croppa.loading"></div>
</croppa>
<croppa passive replace-drop ref="myCroppa" v-model="croppa" :width="width" :height="height" @initial-image-loaded="onInitialLoaded"
<!-- <croppa passive replace-drop ref="myCroppa" v-model="croppa" :width="width" :height="height" @initial-image-loaded="onInitialLoaded"
:prevent-white-space="preventWhiteSpace" placeholder="Preview" initial-position="50% 50%" initial-size="cover" @init="onInit"
show-loading :image-border-radius="borderRadius">
</croppa>
</croppa> -->
<!-- <img crossOrigin="anonymous" src="https://raw.githubusercontent.com/recurser/exif-orientation-examples/master/Portrait_6.jpg"
ref="foo" class="external"> -->
<br>
Expand Down Expand Up @@ -149,6 +149,7 @@ <h1>Vue-Croppa Simple Test</h1>
this.croppa.refresh()

// console.log('eq', this.$refs.myCroppa === this.croppa)
window.croppa = this.croppa;
},

methods: {
Expand Down
12 changes: 8 additions & 4 deletions docs/src/croppa/vue-croppa.js

Large diffs are not rendered by default.

Loading

0 comments on commit 0e6eadb

Please sign in to comment.