提交 1f2c63b3 编写于 作者: C Catouse

* change api of image cutter.

上级 ee9a4680
......@@ -9,7 +9,10 @@
(function($, Math) {
'use strict';
var name = 'zui.imgcutter';
var ImgCutter = function(element, options) {
this.name = name;
this.$ = $(element);
this.initOptions(options);
this.init();
......@@ -26,7 +29,8 @@
}; // default options
ImgCutter.prototype.callEvent = function(name, params) {
return $.zui.callEvent(this.options[name], params);
var result = this.$.callEvent(name + '.' + this.name, params, this);
return !(result.result !== undefined && (!result.result));
};
ImgCutter.prototype.initOptions = function(options) {
......@@ -143,8 +147,10 @@
var data = {
originWidth: that.imgWidth,
originHeight: that.imgHeight,
width: that.width,
height: that.height,
scaleWidth: that.width,
scaleHeight: that.height,
width: that.right - that.left,
height: that.bottom - that.top,
left: that.left,
top: that.top,
right: that.right,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册