提交 57dd7823 编写于 作者: C Catouse

* updated template.

上级 901978cf
......@@ -2,12 +2,14 @@
+function($, window, document, Math)
{
"use strict";
var name = 'zui.$componentObject$';
var $ComponentName$ = function(element, options)
{
this.name = name;
this.$ = $(element);
this.getOptions(options);
this.getOptions(options);
this.init();
};
......@@ -21,17 +23,23 @@
$ComponentName$.prototype.init = function()
{
// ...
}
};
$ComponentName$.prototype.callEvent = function(name, params)
{
var result = this.$.callEvent(name + '.' + this.name, params, this);
return !(result.result != undefined && (!result.result));
};
$.fn.$componentObject$ = function(option)
{
return this.each(function()
{
var $this = $(this);
var data = $this.data('zui.$componentObject$');
var data = $this.data(name);
var options = typeof option == 'object' && option;
if (!data) $this.data('zui.$componentObject$', (data = new $ComponentName$(this, options)));
if (!data) $this.data(name, (data = new $ComponentName$(this, options)));
if (typeof option == 'string') data[option]();
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册