id can be any valid string
This commit is contained in:
parent
8f3fef4425
commit
70eedc2d7b
1 changed files with 3 additions and 7 deletions
|
|
@ -90,14 +90,10 @@ module.exports.widgets = function(data,parent) {
|
|||
|
||||
if (widgetData.id=='auto') {
|
||||
var id
|
||||
while (id=widgetData.type+'_'+getIterator(widgetData.type,'widget')) {
|
||||
if (!WIDGETS.hasOwnProperty(id)) {
|
||||
widgetData.id = id
|
||||
break
|
||||
}
|
||||
while (!id || WIDGETS[id]) {
|
||||
id=widgetData.type+'_'+getIterator(widgetData.type,'widget')
|
||||
}
|
||||
} else {
|
||||
widgetData.id = widgetData.id.replace(' ','_')
|
||||
widgetData.id = id
|
||||
}
|
||||
|
||||
widgetData.path = widgetData.path=='auto'?'/' + widgetData.id:widgetData.path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue