Skip to content

Commit 2fd2f1f

Browse files
committed
Merge pull request #8 from lfbittencourt/master
Enabled custom crop in the widget.
2 parents 94fcea4 + 380826f commit 2fd2f1f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

plugin.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
UPLOADCARE_CROP = true;
2-
31
CKEDITOR.plugins.add('uploadcare', {
42
init : function(editor) {
53
var me = this;
64
var _file_id;
75

8-
UPLOADCARE_CROP = !editor.config.USE_PHP;
6+
// Check for custom crop
7+
if (!!editor.config.USE_PHP) {
8+
UPLOADCARE_CROP = false;
9+
} else if (typeof UPLOADCARE_CROP === 'undefined') {
10+
UPLOADCARE_CROP = true;
11+
}
12+
913
UPLOADCARE_AUTOSTORE = !editor.config.USE_PHP;
1014
CKEDITOR.scriptLoader.load('https://ucarecdn.com/widget/0.13.3/uploadcare/uploadcare-0.13.3.min.js');
1115

0 commit comments

Comments
 (0)