Roo/htmleditor/BlockFigure.js
authorAlan <alan@roojs.com>
Wed, 5 Jan 2022 04:58:13 +0000 (12:58 +0800)
committerAlan <alan@roojs.com>
Wed, 5 Jan 2022 04:58:13 +0000 (12:58 +0800)
Roo/htmleditor/BlockFigure.js

index c52c260..016bceb 100644 (file)
@@ -196,6 +196,8 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
         var d = document.createElement('div');
         d.innerHTML = this.caption;
         
+        var m = this.width == '50%' && this.align == 'center' ? '0 auto' : 0; 
+        
         return  {
             tag: 'figure',
             'data-block' : 'Figure',
@@ -205,7 +207,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
                 float :  this.align ,
                 'max-width':  this.width,
                 width : 'auto',
-                margin:  0,
+                margin:  m,
                 padding: '10px'
                 
             },