|
|
|
@ -78,10 +78,16 @@ if (!window.BI) {
|
|
|
|
|
return widget instanceof BI.Widget || (BI.View && widget instanceof BI.View); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
createWidgets: function (items, options) { |
|
|
|
|
createWidgets: function (items, options, context) { |
|
|
|
|
if (!BI.isArray(items)) { |
|
|
|
|
throw new Error("cannot create Widgets"); |
|
|
|
|
} |
|
|
|
|
if (BI.isWidget(options)) { |
|
|
|
|
context = options; |
|
|
|
|
options = {}; |
|
|
|
|
} else { |
|
|
|
|
options || (options = {}); |
|
|
|
|
} |
|
|
|
|
return BI.map(BI.flatten(items), function (i, item) { |
|
|
|
|
return BI.createWidget(item, BI.deepClone(options)); |
|
|
|
|
}); |
|
|
|
|