From: Alan Knowles Date: Fri, 27 Nov 2020 05:18:07 +0000 (+0800) Subject: fix weights list X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=207266a952895d8d8886301ef073432e320290d0 fix weights list --- diff --git a/Roo/bootstrap/Button.js b/Roo/bootstrap/Button.js index de39a37240..a022a20341 100644 --- a/Roo/bootstrap/Button.js +++ b/Roo/bootstrap/Button.js @@ -10,8 +10,8 @@ * @extends Roo.bootstrap.Component * Bootstrap Button class * @cfg {String} html The button content - * @cfg {String} weight (default|primary|secondary|success|info|warning|danger|link ) default - * @cfg {String} badge_weight (default|primary|secondary|success|info|warning|danger|link ) default (same as button) + * @cfg {String} weight (default|primary|secondary|success|info|warning|danger|link|light|dark) default + * @cfg {String} badge_weight (default|primary|secondary|success|info|warning|danger|link|light|dark) default (same as button) * @cfg {Boolean} outline default false (except for weight=default which emulates old behaveiour with an outline) * @cfg {String} size (lg|sm|xs) * @cfg {String} tag (a|input|submit) @@ -39,14 +39,7 @@ Roo.bootstrap.Button = function(config){ Roo.bootstrap.Button.superclass.constructor.call(this, config); - this.weightClass = ["btn-default btn-outline-secondary", - "btn-primary", - "btn-success", - "btn-info", - "btn-warning", - "btn-danger", - "btn-link" - ], + this.addEvents({ // raw events /** @@ -143,8 +136,8 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { return cfg; } + - if (this.theme==='default') { cfg.cls = 'btn roo-button'; @@ -410,7 +403,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { setWeight : function(str) { - this.el.removeClass(this.weightClass); + this.el.removeClass(Roo.bootstrap.Button.weightClass ); this.weight = str; var outline = this.outline ? 'outline-' : ''; if (str == 'default') { @@ -422,5 +415,17 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { }); - - \ No newline at end of file +Roo.bootstrap.Button.weightClass = [ + + "btn-default", + "btn-outline-secondary", + "btn-secondary", + "btn-primary", + "btn-success", + "btn-info", + "btn-warning", + "btn-danger", + "btn-link", + 'btn-light', + 'btn-dark' +]; \ No newline at end of file diff --git a/docs/summary.txt b/docs/summary.txt index 454b6de73b..2716d80365 100644 --- a/docs/summary.txt +++ b/docs/summary.txt @@ -145,10 +145,11 @@ Bootstrap Widgets Cards Roo.bootstrap.Card a interactive card element (dragable / expandabe etc.) - [examples/bootstrap4/dashboard4.html] Dragable Trello like cards. Roo.bootstrap.CardHeader container for header elements Roo.bootstrap.CardFooter container for footer elements Roo.bootstrap.CardImageTop container for footer elements + Examples + [examples/bootstrap4/dashboard4.html] Dragable Trello like cards. Html Roo.bootstrap.Img Images