mirror of https://github.com/layui/layui
commit
05891a87aa
|
@ -209,12 +209,12 @@ layui.define(['lay', 'util', 'element', 'form'], function(exports){
|
||||||
elemToolbar.on('click', '>i', function(){
|
elemToolbar.on('click', '>i', function(){
|
||||||
var oi = $(this);
|
var oi = $(this);
|
||||||
var type = oi.data('type');
|
var type = oi.data('type');
|
||||||
typeof tools[type].event === 'function' && tools[type].event(oi, type);
|
tools[type] && typeof tools[type].event === 'function' && tools[type].event(oi, type);
|
||||||
typeof options.toolsEvent === 'function' && options.toolsEvent(oi, type);
|
typeof options.toolsEvent === 'function' && options.toolsEvent(oi, type);
|
||||||
});
|
});
|
||||||
layui.each(options.tools, function(i, v){
|
layui.each(options.tools, function(i, v){
|
||||||
var className = (tools[v] && tools[v].className) || v;
|
var className = (tools[v] && tools[v].className) || v;
|
||||||
var title = tools[v].title || [''];
|
var title = (tools[v] && tools[v].title) || [''];
|
||||||
elemToolbar.append(
|
elemToolbar.append(
|
||||||
'<i class="layui-icon layui-icon-'+ className +'" data-type="'+ v +'" title="'+ title[0] +'"></i>'
|
'<i class="layui-icon layui-icon-'+ className +'" data-type="'+ v +'" title="'+ title[0] +'"></i>'
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue