[Common] refactoring
This commit is contained in:
parent
72eda1de98
commit
f5bb8c8ed8
|
@ -119,18 +119,20 @@ define([
|
||||||
], function () {
|
], function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var templateBtnIcon =
|
||||||
|
'<% if ( iconImg ) { %>' +
|
||||||
|
'<img src="<%= iconImg %>">' +
|
||||||
|
'<% } else { %>' +
|
||||||
|
'<% if (/svgicon/.test(iconCls)) {' +
|
||||||
|
'print(\'<svg width="26" height="26" class=\"icon\"><use href=\"#\' + /svgicon\\s(\\S+)/.exec(iconCls)[1] + \'\"></use></svg>\');' +
|
||||||
|
'} else ' +
|
||||||
|
'print(\'<i class=\"icon \' + iconCls + \'\"> </i>\'); %>' +
|
||||||
|
'<% } %>';
|
||||||
|
|
||||||
var templateHugeCaption =
|
var templateHugeCaption =
|
||||||
'<button type="button" class="btn dropdown-toggle <%= cls %>" data-toggle="dropdown">' +
|
'<button type="button" class="btn <%= cls %>">' +
|
||||||
'<div class="inner-box-icon">' +
|
'<div class="inner-box-icon">' +
|
||||||
'<% if ( iconImg ) { %>' +
|
templateBtnIcon +
|
||||||
'<img src="<%= iconImg %>">' +
|
|
||||||
'<% } else { %>' +
|
|
||||||
'<% if (/svgicon/.test(iconCls)) {' +
|
|
||||||
'print(\'<svg class=\"icon\"><use xlink:href=\"#\' + /svgicon\\s(\\S+)/.exec(iconCls)[1] + \'\"></use></svg>\');' +
|
|
||||||
'} else ' +
|
|
||||||
'print(\'<i class=\"icon \' + iconCls + \'\"> </i>\'); %>' +
|
|
||||||
// '<i class="icon <%= iconCls %>"> </i>' +
|
|
||||||
'<% } %>' +
|
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<span class="caption"><%= caption %></span>' +
|
'<span class="caption"><%= caption %></span>' +
|
||||||
'</button>';
|
'</button>';
|
||||||
|
@ -139,11 +141,7 @@ define([
|
||||||
'<div class="btn-group icon-top" id="<%= id %>" style="<%= style %>">' +
|
'<div class="btn-group icon-top" 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">' +
|
||||||
'<div class="inner-box-icon">' +
|
'<div class="inner-box-icon">' +
|
||||||
'<% if ( iconImg ) { %>' +
|
templateBtnIcon +
|
||||||
'<img src="<%= iconImg %>">' +
|
|
||||||
'<% } else { %>' +
|
|
||||||
'<i class="icon <%= iconCls %>"> </i>' +
|
|
||||||
'<% } %>' +
|
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<div class="inner-box-caption">' +
|
'<div class="inner-box-caption">' +
|
||||||
'<span class="caption"><%= caption %></span>' +
|
'<span class="caption"><%= caption %></span>' +
|
||||||
|
@ -155,11 +153,7 @@ define([
|
||||||
var templateHugeSplitCaption =
|
var templateHugeSplitCaption =
|
||||||
'<div class="btn-group x-huge split icon-top" id="<%= id %>" style="<%= style %>">' +
|
'<div class="btn-group x-huge split icon-top" id="<%= id %>" style="<%= style %>">' +
|
||||||
'<button type="button" class="btn <%= cls %> inner-box-icon">' +
|
'<button type="button" class="btn <%= cls %> inner-box-icon">' +
|
||||||
'<% if ( iconImg ) { %>' +
|
templateBtnIcon +
|
||||||
'<img src="<%= iconImg %>">' +
|
|
||||||
'<% } else { %>' +
|
|
||||||
'<i class="icon <%= iconCls %>"> </i>' +
|
|
||||||
'<% } %>' +
|
|
||||||
'</button>' +
|
'</button>' +
|
||||||
'<button type="button" class="btn <%= cls %> inner-box-caption dropdown-toggle" data-toggle="dropdown">' +
|
'<button type="button" class="btn <%= cls %> inner-box-caption dropdown-toggle" data-toggle="dropdown">' +
|
||||||
'<span class="caption"><%= caption %></span>' +
|
'<span class="caption"><%= caption %></span>' +
|
||||||
|
|
|
@ -103,10 +103,16 @@
|
||||||
button.disabled > .@{icon-class} {background-position-x: -3*@icon-size !important; --bgX: -(3*@icon-size);}
|
button.disabled > .@{icon-class} {background-position-x: -3*@icon-size !important; --bgX: -(3*@icon-size);}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mx-button-otherstates-icon2(@icon-size) {
|
||||||
|
&.active .icon,
|
||||||
|
&:active .icon {background-position-x: -1*@icon-size; --bgX: -(1*@icon-size);}
|
||||||
|
&.disabled .icon {background-position-x: -2*@icon-size; --bgX: -(2*@icon-size);}
|
||||||
|
}
|
||||||
|
|
||||||
.button-otherstates-icon2(@icon-class, @icon-size) {
|
.button-otherstates-icon2(@icon-class, @icon-size) {
|
||||||
button.@{icon-class}.active .icon,
|
button.@{icon-class} {
|
||||||
button.@{icon-class}:active .icon {background-position-x: -1*@icon-size; --bgX: -(1*@icon-size);}
|
.mx-button-otherstates-icon2(@icon-size);
|
||||||
button.@{icon-class}.disabled .icon {background-position-x: -2*@icon-size; --bgX: -(2*@icon-size);}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-icon-normal(@icon-class, @index, @icon-size) {
|
.menu-icon-normal(@icon-class, @index, @icon-size) {
|
||||||
|
|
Loading…
Reference in a new issue