Merge branch 'master' of http://git.roojs.com:8081/roojs1
authorEdward <edward@roojs.com>
Fri, 16 May 2014 04:48:33 +0000 (12:48 +0800)
committerEdward <edward@roojs.com>
Fri, 16 May 2014 04:48:33 +0000 (12:48 +0800)
Roo/HtmlEditorCore.js
Roo/bootstrap/Button.js
Roo/bootstrap/Component.js
Roo/bootstrap/HtmlEditor.js

index 7520ff4..4fcf6d6 100644 (file)
@@ -237,7 +237,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
     // private
     onResize : function(w, h)
     {
-        //Roo.log('resize: ' +w + ',' + h );
+         Roo.log('resize: ' +w + ',' + h );
         //Roo.HtmlEditorCore.superclass.onResize.apply(this, arguments);
         if(!this.iframe){
             return;
@@ -266,11 +266,11 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
         
         if(this.sourceEditMode){
  
-            this.iframe.className = 'x-hidden hide';     //FIXME - what's the BS styles for these
+            Roo.get(this.iframe).addClass(['x-hidden','hide']);     //FIXME - what's the BS styles for these
             
         }else{
-            this.iframe.className = '';
+            Roo.get(this.iframe).removeClass(['x-hidden','hide']);
+            //this.iframe.className = '';
             this.deferFocus();
         }
         //this.setSize(this.owner.wrap.getSize());
index f50379e..4942c9b 100644 (file)
@@ -70,6 +70,10 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
     name: false,
     target: false,
     
+    
+    pressed : null,
+    
+    
     getAutoCreate : function(){
         
         var cfg = {
@@ -86,7 +90,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
         }
         cfg.html = this.html || cfg.html;
         
-        if (this.toggle===true) {
+        if (this.toggle === true) {
             cfg={
                 tag: 'div',
                 cls: 'slider-frame roo-button',
@@ -268,6 +272,12 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
         if(this.preventDefault){
             e.preventDefault();
         }
+        if (this.pressed === true || this.pressed === false) {
+            this.pressed = !this.pressed;
+            this[this.pressed ? 'addClass' : 'removeClass']('active');
+            this.fireEvent('toggle', this,e);
+        }
+        
         
         this.fireEvent('click', this, e);
     }
index 7045f9b..b7c75e2 100644 (file)
@@ -234,8 +234,8 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
                  
                 // actually if flexy:foreach is found, we really want to create 
                 // multiple copies here...
-                Roo.log('render');
-                Roo.log(this[cntr]());
+                //Roo.log('render');
+                //Roo.log(this[cntr]());
                 cn.render(this[cntr]());
              }
             // then add the element..
index 99ee032..433e530 100644 (file)
@@ -226,7 +226,7 @@ Roo.extend(Roo.bootstrap.HtmlEditor, Roo.bootstrap.TextArea,  {
     // private
     onResize : function(w, h)
     {
-        //Roo.log('resize: ' +w + ',' + h );
+        Roo.log('resize: ' +w + ',' + h );
         Roo.bootstrap.HtmlEditor.superclass.onResize.apply(this, arguments);
         var ew = false;
         var eh = false;
@@ -238,14 +238,15 @@ Roo.extend(Roo.bootstrap.HtmlEditor, Roo.bootstrap.TextArea,  {
                 ew = aw;
             }
             if(typeof h == 'number'){
-                var tbh = 0;
+                 var tbh = -11;  // fixme it needs to tool bar size!
                 for (var i =0; i < this.toolbars.length;i++) {
                     // fixme - ask toolbars for heights?
-                    tbh += this.toolbars[i].tb.el.getHeight();
-                    if (this.toolbars[i].footer) {
-                        tbh += this.toolbars[i].footer.el.getHeight();
-                    }
+                    tbh += this.toolbars[i].el.getHeight();
+                    //if (this.toolbars[i].footer) {
+                    //    tbh += this.toolbars[i].footer.el.getHeight();
+                    //}
                 }
+