add icon support in label
This commit is contained in:
parent
794fa01319
commit
fe10029b8f
3 changed files with 16 additions and 5 deletions
|
|
@ -1,6 +1,7 @@
|
|||
var widgets = require('./widgets'),
|
||||
widgetOptions = widgets.widgetOptions,
|
||||
createWidget = widgets.createWidget
|
||||
createWidget = widgets.createWidget,
|
||||
icon = require('./utils').icon
|
||||
|
||||
var getIterator = function(id,type){
|
||||
var iterator = MISC.iterators[type]
|
||||
|
|
@ -135,7 +136,11 @@ module.exports.widgets = function(data,parent) {
|
|||
styleL = widgetData.left&&widgetData.left!='auto'||widgetData.left==0?`left:${left};`:'',
|
||||
styleT = widgetData.top&&widgetData.top!='auto'||widgetData.top==0?`top:${top};`:''
|
||||
|
||||
var label = widgetData.label == 'auto'?widgetData.id:widgetData.label
|
||||
var label = widgetData.label == 'auto'?
|
||||
widgetData.id:
|
||||
typeof widgetData.label == 'string' && widgetData.label.indexOf('icon:')!=-1?
|
||||
icon(widgetData.label.split(':')[1].trim()):
|
||||
widgetData.label
|
||||
|
||||
var widgetContainer = $(`
|
||||
<div class="widget ${widgetData.type}-container ${styleL.length || styleT.length?'absolute-position':''}" style="${styleW + styleH + styleL + styleT + widgetData.css}">
|
||||
|
|
|
|||
|
|
@ -1182,7 +1182,8 @@ module.exports = function(session,callback) {
|
|||
},{"./actions":2,"./editor/init":7,"./parser":10,"./ui":12,"./widgets":14}],10:[function(require,module,exports){
|
||||
var widgets = require('./widgets'),
|
||||
widgetOptions = widgets.widgetOptions,
|
||||
createWidget = widgets.createWidget
|
||||
createWidget = widgets.createWidget,
|
||||
icon = require('./utils').icon
|
||||
|
||||
var getIterator = function(id,type){
|
||||
var iterator = MISC.iterators[type]
|
||||
|
|
@ -1317,7 +1318,11 @@ module.exports.widgets = function(data,parent) {
|
|||
styleL = widgetData.left&&widgetData.left!='auto'||widgetData.left==0?`left:${left};`:'',
|
||||
styleT = widgetData.top&&widgetData.top!='auto'||widgetData.top==0?`top:${top};`:''
|
||||
|
||||
var label = widgetData.label == 'auto'?widgetData.id:widgetData.label
|
||||
var label = widgetData.label == 'auto'?
|
||||
widgetData.id:
|
||||
typeof widgetData.label == 'string' && widgetData.label.indexOf('icon:')!=-1?
|
||||
icon(widgetData.label.split(':')[1].trim()):
|
||||
widgetData.label
|
||||
|
||||
var widgetContainer = $(`
|
||||
<div class="widget ${widgetData.type}-container ${styleL.length || styleT.length?'absolute-position':''}" style="${styleW + styleH + styleL + styleT + widgetData.css}">
|
||||
|
|
@ -1360,7 +1365,7 @@ module.exports.widgets = function(data,parent) {
|
|||
|
||||
}
|
||||
|
||||
},{"./widgets":14}],11:[function(require,module,exports){
|
||||
},{"./utils":13,"./widgets":14}],11:[function(require,module,exports){
|
||||
var actions = require('./actions'),
|
||||
icon = require('./utils').icon
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue