Roo/bootstrap/Button.js
[roojs1] / roojs-bootstrap-debug.js
index ddb0fb5..b3eff16 100644 (file)
@@ -589,7 +589,7 @@ Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component,  {
  * @cfg {String} href empty or href
  * @cfg {Boolean} disabled default false;
  * @cfg {Boolean} isClose default false;
- * @cfg {String} glyphicon (| adjust | align-center | align-justify | align-left | align-right | arrow-down | arrow-left | arrow-right | arrow-up | asterisk | backward | ban-circle | barcode | bell | bold | book | bookmark | briefcase | bullhorn | calendar | camera | certificate | check | chevron-down | chevron-left | chevron-right | chevron-up | circle-arrow-down | circle-arrow-left | circle-arrow-right | circle-arrow-up | cloud | cloud-download | cloud-upload | cog | collapse-down | collapse-up | comment | compressed | copyright-mark | credit-card | cutlery | dashboard | download | download-alt | earphone | edit | eject | envelope | euro | exclamation-sign | expand | export | eye-close | eye-open | facetime-video | fast-backward | fast-forward | file | film | filter | fire | flag | flash | floppy-disk | floppy-open | floppy-remove | floppy-save | floppy-saved | folder-close | folder-open | font | forward | fullscreen | gbp | gift | glass | globe | hand-down | hand-left | hand-right | hand-up | hd-video | hdd | header | headphones | heart | heart-empty | home | import | inbox | indent-left | indent-right | info-sign | italic | leaf | link | list | list-alt | lock | log-in | log-out | magnet | map-marker | minus | minus-sign | move | music | new-window | off | ok | ok-circle | ok-sign | open | paperclip | pause | pencil | phone | phone-alt | picture | plane | play | play-circle | plus | plus-sign | print | pushpin | qrcode | question-sign | random | record | refresh | registration-mark | remove | remove-circle | remove-sign | repeat | resize-full | resize-horizontal | resize-small | resize-vertical | retweet | road | save | saved | screenshot | sd-video | search | send | share | share-alt | shopping-cart | signal | sort | sort-by-alphabet | sort-by-alphabet-alt | sort-by-attributes | sort-by-attributes-alt | sort-by-order | sort-by-order-alt | sound-5-1 | sound-6-1 | sound-7-1 | sound-dolby | sound-stereo | star | star-empty | stats | step-backward | step-forward | stop | subtitles | tag | tags | tasks | text-height | text-width | th | th-large | th-list | thumbs-down | thumbs-up | time | tint | tower | transfer | trash | tree-conifer | tree-deciduous | unchecked | upload | usd | user | volume-down | volume-off | volume-up | warning-sign | wrench | zoom-in | zoom-out)
+ * @cfg {String} glyphicon depricated - use fs
  * @cfg {String} badge text for badge
  * @cfg {String} theme (default|glow)  
  * @cfg {Boolean} inverse dark themed version
@@ -649,6 +649,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
     disabled: false,
     isClose: false,
     glyphicon: '',
+    fa: '',
     badge: '',
     theme: 'default',
     inverse: false,
@@ -759,6 +760,10 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
             Roo.log('changing to ul' );
             cfg.tag = 'ul';
             this.glyphicon = 'caret';
+            if (Roo.bootstrap.version == 4) {
+                this.fa = 'caret-down';
+            }
+            
         }
         
         cfg.cls += this.size.length ? (' btn-' + this.size) : '';
@@ -797,6 +802,16 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
                 }
             ];
         }
+        if (this.fa) {
+            cfg.html = ' ' + cfg.html;
+            
+            cfg.cn = [
+                {
+                    tag: 'i',
+                    cls: 'fa fas fa-' + this.fa
+                }
+            ];
+        }
         
         if (this.badge) {
             cfg.html += ' ';
@@ -811,12 +826,19 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
             
             if(this.glyphicon){
                 value = {
-                            tag: 'span',
-                            cls: 'glyphicon glyphicon-' + this.glyphicon,
-                            html: this.html
-                        };
-                
+                    tag: 'span',
+                    cls: 'glyphicon glyphicon-' + this.glyphicon,
+                    html: this.html
+                };
             }
+            if(this.fa){
+                value = {
+                    tag: 'i',
+                    cls: 'fa fas fa-' + this.fa,
+                    html: this.html
+                };
+            }
+            
             var bw = this.badge_weight.length ? this.badge_weight :
                 (this.weight.length ? this.weight : 'secondary');
             bw = bw == 'default' ? 'secondary' : bw;