From b6a37f0160356407d2569e3977351ab58e337185 Mon Sep 17 00:00:00 2001 From: Edward Date: Wed, 16 Apr 2014 21:05:55 +0800 Subject: [PATCH] Roo/bootstrap/Button.js --- Roo/bootstrap/Button.js | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/Roo/bootstrap/Button.js b/Roo/bootstrap/Button.js index 8395226e13..3426b9faa1 100644 --- a/Roo/bootstrap/Button.js +++ b/Roo/bootstrap/Button.js @@ -150,6 +150,59 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { cfg.cls += ' active'; } + if (this.disabled) { + cfg.disabled = 'disabled'; + } + //???? + if (this.items) { + Roo.log('changing to ul' ); + cfg.tag = 'ul'; + this.glyphicon = 'caret'; + } + + if (this.glyphicon) { + cfg.html = ' ' + cfg.html; + + cfg.cn = [ + { + tag: 'span', + cls: 'glyphicon glyphicon-' + this.glyphicon + } + ]; + } + + if (this.badge) { + cfg.html += ' '; + + cfg.tag = 'a'; + +// cfg.cls='btn roo-button'; + + cfg.href=this.href; + + var value = cfg.html; + + if(this.glyphicon){ + value = { + tag: 'span', + cls: 'glyphicon glyphicon-' + this.glyphicon, + html: this.html + }; + + } + + cfg.cn = [ + value, + { + tag: 'span', + cls: 'badge', + html: this.badge + } + ]; + + cfg.html=''; + } + cfg.cls += this.size.length ? (' btn-' + this.size) : ''; //gsRoo.log(this.parentType); -- 2.39.2