From f5aa547f4331df9701d7bac30954de35692bc632 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 2 Jul 2012 18:21:09 +0200 Subject: [PATCH] Ox.IconList: don't require 'keys' option if 'items' is a local array --- source/Ox.UI/js/List/IconList.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/Ox.UI/js/List/IconList.js b/source/Ox.UI/js/List/IconList.js index 68a32080..1337c9ae 100644 --- a/source/Ox.UI/js/List/IconList.js +++ b/source/Ox.UI/js/List/IconList.js @@ -74,6 +74,14 @@ Ox.IconList = function(options, self) { 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.iconHeight = self.options.fixedRatio > 1 ? Math.round(self.options.size / self.options.fixedRatio)