From 15da19dceaa26f02b0e346c37dc265ceb19dec3e Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Mon, 6 Aug 2018 10:28:02 +0900 Subject: [PATCH] fix use of HTML tag or CSS class specification as icon of typedInput --- editor/js/ui/common/typedInput.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/editor/js/ui/common/typedInput.js b/editor/js/ui/common/typedInput.js index 2243f0718..6aab0bf53 100644 --- a/editor/js/ui/common/typedInput.js +++ b/editor/js/ui/common/typedInput.js @@ -522,10 +522,18 @@ this.selectLabel.empty(); var image; if (opt.icon) { - image = new Image(); - image.name = opt.icon; - image.src = opt.icon; - $('',{src:opt.icon,style:"margin-right: 4px;height: 18px;"}).prependTo(this.selectLabel); + if (opt.icon.indexOf("<") === 0) { + $(opt.icon).prependTo(this.selectLabel); + } + else if (opt.icon.indexOf("/") !== -1) { + image = new Image(); + image.name = opt.icon; + image.src = opt.icon; + $('',{src:opt.icon,style:"margin-right: 4px;height: 18px;"}).prependTo(this.selectLabel); + } + else { + $('',{class:"red-ui-typedInput-icon "+opt.icon}).prependTo(this.selectLabel); + } } else { this.selectLabel.text(opt.label); }