Ox.IconList: don't require 'keys' option if 'items' is a local array
This commit is contained in:
parent
6f4ee1229f
commit
f5aa547f43
1 changed files with 8 additions and 0 deletions
|
@ -74,6 +74,14 @@ Ox.IconList = function(options, self) {
|
||||||
self.options.defaultRatio = self.options.fixedRatio;
|
self.options.defaultRatio = self.options.fixedRatio;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Ox.isArray(self.options.items)) {
|
||||||
|
self.options.keys = Ox.unique(Ox.flatten(
|
||||||
|
self.options.items.map(function(item) {
|
||||||
|
return Object.keys(item);
|
||||||
|
})
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
self.iconWidth = self.options.size;
|
self.iconWidth = self.options.size;
|
||||||
self.iconHeight = self.options.fixedRatio > 1
|
self.iconHeight = self.options.fixedRatio > 1
|
||||||
? Math.round(self.options.size / self.options.fixedRatio)
|
? Math.round(self.options.size / self.options.fixedRatio)
|
||||||
|
|
Loading…
Reference in a new issue