From 3414fff4b9e4a817b6b645bf7297644491e13967 Mon Sep 17 00:00:00 2001 From: Sergey Krivochenko Date: Sat, 30 Sep 2017 16:31:45 +0300 Subject: [PATCH] [fix] - incorrect using widget parameters when calculate crop ratio --- Widget.php | 2 +- views/widget.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Widget.php b/Widget.php index 54693c1..31ec660 100644 --- a/Widget.php +++ b/Widget.php @@ -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 ); } diff --git a/views/widget.php b/views/widget.php index cb932db..08cb6b0 100644 --- a/views/widget.php +++ b/views/widget.php @@ -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 ]