Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Create image.js
Browse files Browse the repository at this point in the history
更改图片尺寸大小bug
  • Loading branch information
woleicom authored Jun 13, 2017
1 parent fe3fc76 commit 039c5cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dialogs/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,22 +177,22 @@
domUtils.on($G("title"), 'keyup', updatePreview);

domUtils.on($G("width"), 'keyup', function(){
updatePreview();
if(locker.checked) {
var proportion =locker.getAttribute('data-proportion');
$G('height').value = Math.round(this.value / proportion);
} else {
_this.updateLocker();
}
updatePreview();
});
domUtils.on($G("height"), 'keyup', function(){
updatePreview();
if(locker.checked) {
var proportion =locker.getAttribute('data-proportion');
$G('width').value = Math.round(this.value * proportion);
} else {
_this.updateLocker();
}
updatePreview();
});
domUtils.on($G("lock"), 'change', function(){
var proportion = parseInt($G("width").value) /parseInt($G("height").value);
Expand Down

0 comments on commit 039c5cc

Please sign in to comment.