docs/src/Roo_bootstrap_Card.js.html
[roojs1] / Roo / Toolbar.js
index 1276e7e..0610c3f 100644 (file)
@@ -523,16 +523,22 @@ Roo.Toolbar.Fill = Roo.extend(Roo.Toolbar.Spacer, {
  * A simple class that renders text directly into a toolbar.
  * @constructor
  * Creates a new TextItem
- * @param {String} text
+ * @cfg {string} text 
  */
 Roo.Toolbar.TextItem = function(cfg){
-    var text = "";
+    var  text = cfg || "";
     if (typeof(cfg) == 'object') {
-        text = cfg.text;
+        text = cfg.text || "";
+    }  else {
+        cfg = null;
     }
     var s = document.createElement("span");
     s.className = "ytb-text";
     s.innerHTML = text;
+    if (cfg) {
+        cfg.el  = s;
+    }
+    
     Roo.Toolbar.TextItem.superclass.constructor.call(this, cfg ||  s);
 };
 Roo.extend(Roo.Toolbar.TextItem, Roo.Toolbar.Item, {