From 33eff9f46dff975b3dd2947000ce4548e88a4e38 Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 10 May 2014 15:11:31 +0200 Subject: [PATCH] IconList: add support for icon extra (overlay) --- source/Ox.UI/js/List/IconItem.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/source/Ox.UI/js/List/IconItem.js b/source/Ox.UI/js/List/IconItem.js index 8d8cc173..94bc6538 100644 --- a/source/Ox.UI/js/List/IconItem.js +++ b/source/Ox.UI/js/List/IconItem.js @@ -26,6 +26,7 @@ Ox.IconItem = function(options, self) { var that = Ox.Element({}, self) .defaults({ borderRadius: 0, + extra: null, find: '', iconHeight: 128, iconWidth: 128, @@ -155,6 +156,28 @@ Ox.IconItem = function(options, self) { ) ); + if (self.options.extra) { + that.$extra = $('
') + .addClass('OxTarget') + .css({ + position: 'absolute', + left: 0, + right: 0, + bottom: 0, + width: self.options.imageWidth + 'px', + height: self.options.imageHeight + 'px', + border: '2px solid transparent', + margin: 'auto', + cursor: 'pointer', + overflow: 'hidden' + }) + that.$icon.append( + that.$extra.append( + self.options.extra + ) + ); + } + function formatText(text, maxLines, maxLength) { text = Ox.isArray(text) ? text.join(', ') : text; var lines = Ox.wordwrap(text, maxLength, true).split('\n');