From 44a8ff015ca80e63291b92f6417bf47fa2bb06af Mon Sep 17 00:00:00 2001
From: rlx <0x0073@0x2620.org>
Date: Thu, 29 Sep 2011 06:17:50 +0000
Subject: [PATCH] in icon lists, support 'info' that is not a string, but an
element
---
source/Ox.UI/css/Ox.UI.css | 8 +++++++-
source/Ox.UI/js/Core/Ox.Keyboard.js | 1 -
source/Ox.UI/js/List/Ox.IconItem.js | 26 +++++++++++++++++++++-----
source/Ox.UI/js/List/Ox.IconList.js | 5 ++++-
4 files changed, 32 insertions(+), 8 deletions(-)
diff --git a/source/Ox.UI/css/Ox.UI.css b/source/Ox.UI/css/Ox.UI.css
index 16da90a2..5da5cfe6 100644
--- a/source/Ox.UI/css/Ox.UI.css
+++ b/source/Ox.UI/css/Ox.UI.css
@@ -1092,8 +1092,14 @@ Lists
border-radius: 4px;
//-moz-user-select: text;
//-webkit-user-select: text;
-
}
+.OxIconList .OxItem > .OxText > div > div,
+.OxIconList .OxItem > .OxText > div > div > div {
+ font-size: 9px;
+ font-weight: bold;
+ text-align: center;
+}
+
.OxTextList {
top: 0;
diff --git a/source/Ox.UI/js/Core/Ox.Keyboard.js b/source/Ox.UI/js/Core/Ox.Keyboard.js
index 7628000e..c9346036 100644
--- a/source/Ox.UI/js/Core/Ox.Keyboard.js
+++ b/source/Ox.UI/js/Core/Ox.Keyboard.js
@@ -101,7 +101,6 @@
buffer = '';
}, 1000);
- Ox.print(ret);
return ret;
}
diff --git a/source/Ox.UI/js/List/Ox.IconItem.js b/source/Ox.UI/js/List/Ox.IconItem.js
index f7b56849..453f9393 100644
--- a/source/Ox.UI/js/List/Ox.IconItem.js
+++ b/source/Ox.UI/js/List/Ox.IconItem.js
@@ -42,12 +42,26 @@ Ox.IconItem = function(options, self) {
Ox.extend(self, {
fontSize: self.options.itemWidth == 64 ? 6 : 9,
+ infoIsObject: Ox.isObject(self.options.info),
lineLength: self.options.itemWidth == 64 ? 15 : 23,
lines: self.options.itemWidth == 64 ? 4 : 5,
url: Ox.UI.PATH + 'png/transparent.png',
});
- self.title = formatText(self.options.title, self.lines - 1, self.lineLength);
- self.info = formatText(self.options.info, 5 - self.title.split('
').length, self.lineLength);
+
+ self.title = formatText(self.options.title, self.lines - 1 - self.infoIsObject, self.lineLength);
+ if (!self.infoIsObject) {
+ self.info = formatText(self.options.info, 5 - self.title.split('
').length, self.lineLength);
+ } else {
+ self.title = $('