Skip to content

Commit 83db272

Browse files
author
Ralph Huwiler
committed
compiled code
1 parent 9bdad9c commit 83db272

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

dist/crop.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export default {
204204
if (this.isResize) {
205205
resizeBar.setProgress(100);
206206
} else {
207-
resizeBar.setProgress(0);
207+
resizeBar.setProgress(50);
208208
}
209209
return this.imgChangeRatio;
210210
},

dist/vue-core-image-upload.vue

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
2-
<div class="g-core-image-upload-btn">
2+
<div class="g-core-image-upload-btn" ref="container">
33
<slot>{{text}}</slot>
44
<form class="g-core-image-upload-form" v-show="!hasImage" method="post" enctype="multipart/form-data" action="/api2/common_user/cropHeadUrl" style="display: block; cursor: pointer; position: absolute; left: 0px; top: 0px; width: 1242px; height: 61px; opacity: 0; margin: 0px; padding: 0px; overflow: hidden;">
5-
<input v-bind:disabled="uploading" v-bind:id="'g-core-upload-input-' + formID" v-bind:name="name" v-bind:multiple="multiple" type="file" v-bind:accept="inputAccept" v-on:change="change" style="width: 100%; height: 100%;">
5+
<input v-bind:disabled="uploading" v-bind:id="'g-core-upload-input-' + formID" v-bind:name="name" v-bind:multiple="multiple" type="file" v-bind:accept="inputAccept" v-on:change="change" v-on:dragover="dragover" v-on:dragenter="dragover" v-on:dragleave="dragleave" v-on:dragend="dragleave" v-on:drop="dragleave" style="width: 100%; height: 100%;">
66
</form>
77
<div class="g-core-image-corp-container" v-bind:id="'vciu-modal-' + formID" v-show="hasImage">
88
<crop ref="cropBox" :is-resize="resize && !crop" :ratio="cropRatio" :is-rotate="rotate"></crop>
@@ -75,6 +75,14 @@
7575
let dq = document.querySelector('#vciu-modal-' + this.formID);
7676
return dq.querySelector(str);
7777
},
78+
dragover() {
79+
let element = this.$refs.container;
80+
element.classList.add('is-dragover');
81+
},
82+
dragleave() {
83+
let element = this.$refs.container;
84+
element.classList.remove('is-dragover');
85+
},
7886
change(e) {
7987
let fileVal = document.querySelector('#g-core-upload-input-' + this.formID).value.replace(/C:\\fakepath\\/i, "");
8088
let fileExt = fileVal.substring(fileVal.lastIndexOf(".") + 1);
@@ -152,7 +160,7 @@
152160
let self = this;
153161
const cropBox = this.$refs.cropBox;
154162
const targetImage = cropBox.getCropImage();
155-
this.data.comprose = 100 - this.compress;
163+
this.data.compress = 100 - this.compress;
156164
return canvasHelper.rotate(targetImage, 1, (src) => {
157165
self.__initImage(src)
158166
})
@@ -162,7 +170,7 @@
162170
let self = this;
163171
const cropBox = this.$refs.cropBox;
164172
const targetImage = cropBox.getCropImage();
165-
this.data.comprose = 100 - this.compress;
173+
this.data.compress = 100 - this.compress;
166174
return canvasHelper.rotate(targetImage, -1, (src) => {
167175
self.__initImage(src)
168176
})
@@ -174,7 +182,7 @@
174182
const upload = this.__setUpload(e.target);
175183
if (this.crop === 'local') {
176184
const targetImage = cropBox.getCropImage();
177-
this.data.comprose = 100 - this.compress;
185+
this.data.compress = 100 - this.compress;
178186
return canvasHelper.crop(targetImage, this.data, (code) => {
179187
upload(code);
180188
this.__dispatch('imagechanged', code);
@@ -189,7 +197,7 @@
189197
const upload = this.__setUpload(e.target);
190198
if (this.resize === 'local') {
191199
const targetImage = cropBox.getCropImage();
192-
this.data.comprose = 100 - this.compress;
200+
this.data.compress = 100 - this.compress;
193201
return canvasHelper.resize(targetImage, this.data, (code) => {
194202
upload(code);
195203
this.__dispatch('imagechanged', code);
@@ -265,7 +273,7 @@
265273
if (isBinary) {
266274
data = {
267275
type: this.files[0]['type'],
268-
filename: encodeURI(this.files[0]['name']),
276+
filename: this.files[0]['name'],
269277
filed: this.inputOfFile,
270278
base64Code: base64Code
271279
};

index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)