aboutsummaryrefslogtreecommitdiffstats
path: root/library/cropperjs/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'library/cropperjs/src/js')
-rw-r--r--library/cropperjs/src/js/constants.js2
-rw-r--r--library/cropperjs/src/js/cropper.js2
-rw-r--r--library/cropperjs/src/js/handlers.js10
-rw-r--r--library/cropperjs/src/js/utilities.js2
4 files changed, 5 insertions, 11 deletions
diff --git a/library/cropperjs/src/js/constants.js b/library/cropperjs/src/js/constants.js
index 015fcbcdd..4f85d60d9 100644
--- a/library/cropperjs/src/js/constants.js
+++ b/library/cropperjs/src/js/constants.js
@@ -1,6 +1,6 @@
export const IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';
export const WINDOW = IS_BROWSER ? window : {};
-export const IS_TOUCH_DEVICE = IS_BROWSER ? 'ontouchstart' in WINDOW.document.documentElement : false;
+export const IS_TOUCH_DEVICE = IS_BROWSER && WINDOW.document.documentElement ? 'ontouchstart' in WINDOW.document.documentElement : false;
export const HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false;
export const NAMESPACE = 'cropper';
diff --git a/library/cropperjs/src/js/cropper.js b/library/cropperjs/src/js/cropper.js
index 24bf81426..a0cb85f3f 100644
--- a/library/cropperjs/src/js/cropper.js
+++ b/library/cropperjs/src/js/cropper.js
@@ -87,7 +87,7 @@ class Cropper {
return;
}
- // e.g.: "http://example.com/img/picture.jpg"
+ // e.g.: "https://example.com/img/picture.jpg"
url = element.src;
} else if (tagName === 'canvas' && window.HTMLCanvasElement) {
url = element.toDataURL();
diff --git a/library/cropperjs/src/js/handlers.js b/library/cropperjs/src/js/handlers.js
index 43f999767..63d18f90e 100644
--- a/library/cropperjs/src/js/handlers.js
+++ b/library/cropperjs/src/js/handlers.js
@@ -10,8 +10,6 @@ import {
EVENT_CROP_END,
EVENT_CROP_MOVE,
EVENT_CROP_START,
- MIN_CONTAINER_WIDTH,
- MIN_CONTAINER_HEIGHT,
REGEXP_ACTIONS,
} from './constants';
import {
@@ -28,15 +26,11 @@ import {
export default {
resize() {
- const { options, container, containerData } = this;
- const minContainerWidth = Number(options.minContainerWidth) || MIN_CONTAINER_WIDTH;
- const minContainerHeight = Number(options.minContainerHeight) || MIN_CONTAINER_HEIGHT;
-
- if (this.disabled || containerData.width <= minContainerWidth
- || containerData.height <= minContainerHeight) {
+ if (this.disabled) {
return;
}
+ const { options, container, containerData } = this;
const ratio = container.offsetWidth / containerData.width;
// Resize when width changed or height changed
diff --git a/library/cropperjs/src/js/utilities.js b/library/cropperjs/src/js/utilities.js
index bb5c7c24c..076b9c3bd 100644
--- a/library/cropperjs/src/js/utilities.js
+++ b/library/cropperjs/src/js/utilities.js
@@ -127,7 +127,7 @@ const REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/;
/**
* Normalize decimal number.
- * Check out {@link http://0.30000000000000004.com/}
+ * Check out {@link https://0.30000000000000004.com/}
* @param {number} value - The value to normalize.
* @param {number} [times=100000000000] - The times for normalizing.
* @returns {number} Returns the normalized number.