From fe41d09acbe8472aab810013435b112b4f61c989 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Wed, 2 Oct 2013 14:34:45 +0000 Subject: [PATCH] Support for input values with no icon. SVN:trunk[2873] --- js/icon_select.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/js/icon_select.js b/js/icon_select.js index 059dd8f6e..264469bb4 100644 --- a/js/icon_select.js +++ b/js/icon_select.js @@ -20,14 +20,21 @@ $(function() var me = this; var sLabel = ''; var sIcon = ''; + for(var i in this.options.items) + { + if(this.options.items[i].icon == '') + { + this.options.items[i].icon = GetAbsoluteUrlAppRoot()+'images/transparent_32_32.png'; + } + } if (this.options.items.length > 0) { sIcon = this.options.items[this.options.current_idx].icon; sLabel = this.options.items[this.options.current_idx].label; } - this.oImg = $(''); + this.oImg = $(''); this.oLabel = $(''+sLabel+''); - this.oButton = $(''); + this.oButton = $(''); this.oButton.prepend(this.oLabel).prepend(this.oImg); this.oButton.click(function(event, ui) { me._on_button_clicked(event, ui); }); this.element.after(this.oButton); @@ -83,7 +90,7 @@ $(function() var sMenu = ''; var iWidth = Math.max(250, this.oButton.width());