@lemonadejs/cropper 1.5.1 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cropper.js +8 -10
  2. package/package.json +1 -1
package/dist/cropper.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * (c) LemonadeJS components
3
3
  *
4
4
  * Website: https://lemonadejs.net
5
- * Description: Image cropper v1.4.1
5
+ * Description: Image cropper v1.5.2
6
6
  *
7
7
  * MIT License
8
8
  *
@@ -43,7 +43,7 @@
43
43
  }
44
44
 
45
45
  return (function() {
46
- var self = {};
46
+ var self = this;
47
47
  var original = self.original ? 1 : 0;
48
48
  var width = self.width || 300;
49
49
  var height = self.height || 240;
@@ -163,13 +163,11 @@
163
163
  newImage.src = filename;
164
164
  // Integration with jSuites.form
165
165
  if (self.name) {
166
- //self.el.content = [data];
167
-
168
166
  newImage.classList.remove('jfile');
169
- } else {
170
- // Legacy
171
- newImage.content = data;
172
167
  }
168
+ // Value
169
+ self.value = [data];
170
+ // Append new image
173
171
  self.image.appendChild(newImage);
174
172
  }
175
173
  // Create image
@@ -255,14 +253,14 @@
255
253
  }
256
254
 
257
255
  self.onload = function() {
258
- self.image.style.width = self.width + 'px';
259
- self.image.style.height = self.height + 'px';
256
+ self.image.style.maxWidth = self.width + 'px';
257
+ self.image.style.maxHeight = self.height + 'px';
260
258
  }
261
259
 
262
260
  // Template
263
261
  var template = `
264
262
  <div name="{{self.name}}" value="{{self.value}}">
265
- <div @ref='self.image' class="jphoto"></div>
263
+ <div @ref='self.image' class="jphoto jcropper"></div>
266
264
  <div @ready='self.createModal(this)'>
267
265
  <div @ready='self.createCropper(this)' @ref='self.cropperArea'></div>
268
266
  <div @ready='self.createControls(this)' class="controls">
package/package.json CHANGED
@@ -19,5 +19,5 @@
19
19
  "@jsuites/cropper": "^1.6.0"
20
20
  },
21
21
  "main": "dist/cropper.js",
22
- "version": "1.5.1"
22
+ "version": "1.5.2"
23
23
  }