[Common] apply button's icon from certain image

This commit is contained in:
Maxim Kadushkin 2017-03-16 12:55:11 +03:00
parent 10a55236d0
commit 994212108f

View file

@ -162,19 +162,19 @@ define([
}, },
template: _.template([ template: _.template([
'<% var applyicon = function() { %>',
'<% if (iconImg) { print(\'<img src=\"\' + iconImg + \'\">\'); } else %>',
'<% if (iconCls != "") { print(\'<i class=\"icon \' + iconCls + \'\">&nbsp;</i>\'); } %>',
'<% } %>',
'<% if ( !menu ) { %>', '<% if ( !menu ) { %>',
'<button type="button" class="btn <%= cls %>" id="<%= id %>" style="<%= style %>">', '<button type="button" class="btn <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<% if (iconCls != "") { %>', '<% applyicon() %>',
'<i class="icon <%= iconCls %>">&nbsp;</i>',
'<% } %>',
'<span class="caption"><%= caption %></span>', '<span class="caption"><%= caption %></span>',
'</button>', '</button>',
'<% } else if (split == false) {%>', '<% } else if (split == false) {%>',
'<div class="btn-group" id="<%= id %>" style="<%= style %>">', '<div class="btn-group" id="<%= id %>" style="<%= style %>">',
'<button type="button" class="btn dropdown-toggle <%= cls %>" data-toggle="dropdown">', '<button type="button" class="btn dropdown-toggle <%= cls %>" data-toggle="dropdown">',
'<% if (iconCls != "") { %>', '<% applyicon() %>',
'<i class="icon <%= iconCls %>">&nbsp;</i>',
'<% } %>',
'<span class="caption"><%= caption %></span>', '<span class="caption"><%= caption %></span>',
'<span class="caret img-commonctrl"></span>', '<span class="caret img-commonctrl"></span>',
'</button>', '</button>',
@ -182,9 +182,7 @@ define([
'<% } else { %>', '<% } else { %>',
'<div class="btn-group split" id="<%= id %>" style="<%= style %>">', '<div class="btn-group split" id="<%= id %>" style="<%= style %>">',
'<button type="button" class="btn <%= cls %>">', '<button type="button" class="btn <%= cls %>">',
'<% if (iconCls != "") { %>', '<% applyicon() %>',
'<i class="icon <%= iconCls %>">&nbsp;</i>',
'<% } %>',
'<span class="caption"><%= caption %></span>', '<span class="caption"><%= caption %></span>',
'</button>', '</button>',
'<button type="button" class="btn <%= cls %> dropdown-toggle" data-toggle="dropdown">', '<button type="button" class="btn <%= cls %> dropdown-toggle" data-toggle="dropdown">',
@ -206,7 +204,6 @@ define([
me.allowDepress = me.options.allowDepress; me.allowDepress = me.options.allowDepress;
me.cls = me.options.cls; me.cls = me.options.cls;
me.iconCls = me.options.iconCls; me.iconCls = me.options.iconCls;
me.iconImg = me.options.iconImg,
me.menu = me.options.menu; me.menu = me.options.menu;
me.split = me.options.split; me.split = me.options.split;
me.toggleGroup = me.options.toggleGroup; me.toggleGroup = me.options.toggleGroup;
@ -247,7 +244,7 @@ define([
id : me.id, id : me.id,
cls : me.cls, cls : me.cls,
iconCls : me.iconCls, iconCls : me.iconCls,
iconImg : me.iconImg, iconImg : me.options.iconImg,
menu : me.menu, menu : me.menu,
split : me.split, split : me.split,
disabled : me.disabled, disabled : me.disabled,