From f645c6f3a57bf5f53bbb2bde362b2447f725c977 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 11 Jan 2020 10:30:12 +0000 Subject: update cropperjs to the recent version --- library/cropperjs/docs/js/main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'library/cropperjs/docs/js/main.js') diff --git a/library/cropperjs/docs/js/main.js b/library/cropperjs/docs/js/main.js index d74afbd60..b54ad6453 100644 --- a/library/cropperjs/docs/js/main.js +++ b/library/cropperjs/docs/js/main.js @@ -1,5 +1,4 @@ window.onload = function () { - 'use strict'; var Cropper = window.Cropper; @@ -49,6 +48,7 @@ window.onload = function () { var cropper = new Cropper(image, options); var originalImageURL = image.src; var uploadedImageType = 'image/jpeg'; + var uploadedImageName = 'cropped.jpg'; var uploadedImageURL; // Tooltip @@ -67,6 +67,7 @@ window.onload = function () { // Download if (typeof download.download === 'undefined') { download.className += ' disabled'; + download.title = 'Your browser does not support download'; } // Options @@ -206,6 +207,7 @@ window.onload = function () { $('#getCroppedCanvasModal').modal().find('.modal-body').html(result); if (!download.disabled) { + download.download = uploadedImageName; download.href = result.toDataURL(uploadedImageType); } } @@ -237,7 +239,7 @@ window.onload = function () { document.body.onkeydown = function (event) { var e = event || window.event; - if (!cropper || this.scrollTop > 300) { + if (e.target !== this || !cropper || this.scrollTop > 300) { return; } @@ -277,6 +279,7 @@ window.onload = function () { if (/^image\/\w+/.test(file.type)) { uploadedImageType = file.type; + uploadedImageName = file.name; if (uploadedImageURL) { URL.revokeObjectURL(uploadedImageURL); -- cgit v1.2.3