Skip to content

Commit

Permalink
[fix] - incorrect using widget parameters when calculate crop ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
krivochenko committed Sep 30, 2017
1 parent 7a4a682 commit 3414fff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function registerClientAssets()
$settings['onCompleteJcrop'] = $this->onCompleteJcrop;

$view->registerJs(
'jQuery("#' . $this->options['id'] . '").parent().find(".new-photo-area").cropper(' . Json::encode($settings) . ', ' . $this->thumbnailWidth . ', ' . $this->thumbnailHeight . ');',
'jQuery("#' . $this->options['id'] . '").parent().find(".new-photo-area").cropper(' . Json::encode($settings) . ', ' . $this->width . ', ' . $this->height . ');',
$view::POS_READY
);
}
Expand Down
2 changes: 1 addition & 1 deletion views/widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
? $model->{$widget->attribute}
: $widget->noPhotoImage,
[
'style' => 'height: ' . $widget->thumbnailHeight . 'px; width: ' . $widget->thumbnailWidth . 'px',
'style' => 'max-height: ' . $widget->thumbnailHeight . 'px; max-width: ' . $widget->thumbnailWidth . 'px',
'class' => 'thumbnail',
'data-no-photo' => $widget->noPhotoImage
]
Expand Down

0 comments on commit 3414fff

Please sign in to comment.