X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2Fhtmleditor%2FBlockFigure.js;h=5ceb4449028414735a7486af3f749ef483a36650;hb=4ed79f6289ef64f2f5b81ce2f0816e9883777ec0;hp=5ab3b00b3b22c9bb443edbb97d23ef93e421b061;hpb=9187e76807c978e0924f273cba221f83a78f6afb;p=roojs1 diff --git a/Roo/htmleditor/BlockFigure.js b/Roo/htmleditor/BlockFigure.js index 5ab3b00b3b..5ceb444902 100644 --- a/Roo/htmleditor/BlockFigure.js +++ b/Roo/htmleditor/BlockFigure.js @@ -234,7 +234,10 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { pressed : false, enableToggle : true, setValue : function(v) { - this.toggle(v == 'block' ? false : true); + // this trigger toggle. + + this.setText(v ? "Hide Caption" : "Show Caption"); + this.setPressed(v); }, listeners : { toggle: function (btn, state) @@ -273,8 +276,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { style: { width : iw, maxWidth : iw + ' !important', // this is not getting rendered? - margin : m - + margin : m } }; @@ -315,7 +317,8 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { // we remove caption totally if its hidden... - will delete data.. but otherwise we end up with fake caption var captionhtml = this.caption_display == 'none' ? '' : (this.caption.length ? this.caption : "Caption"); - return { + + var ret = { tag: 'figure', 'data-block' : 'Figure', @@ -327,7 +330,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { maxWidth : this.align == 'center' ? '100% !important' : (this.width + ' !important'), width : this.align == 'center' ? '100%' : this.width, margin: '0px', - padding: '10px', + padding: this.align == 'center' ? '0' : '0 10px' , textAlign : this.align // seems to work for email.. }, @@ -376,6 +379,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { } ] }; + return ret; },