id can be any valid string

This commit is contained in:
jean-emmanuel 2016-03-21 16:39:20 +01:00
parent 8f3fef4425
commit 70eedc2d7b

View file

@ -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