/**
* 按钮控件
*
* @file 按钮控件
* @author Brian Li (lbxxlht@163.com)
*/
var define = typeof define === 'function' && define.amd ? define : function (factory) {
typeof module === 'object' ? (module.exports = factory(require)) : '';
};
define(function (require) {
var Controller = require('../core/controller');
var util = require('../core/util');
// public /////////////////////////////////////////////////////////////////
/**
* Button构造函数
*
* @param {Object} param 初始化参数
* @return {Button} Button实例
*/
function Button(param) {
if (!(this instanceof Button)) {
return new Button(param);
}
param = param || {};
// 原始模板
param.tpl = '';
// 调用父类初始化
Controller.call(this, param);
// 初始化完毕后的附加修改
if (param.disable) {
this.disable = true;
}
}
util.inherit(Button, Controller);
return Button;
});
|