Roo/htmleditor/BlockFigure.js
authorleon <leon@roojs.com>
Mon, 28 Aug 2023 02:29:05 +0000 (10:29 +0800)
committerleon <leon@roojs.com>
Mon, 28 Aug 2023 02:29:05 +0000 (10:29 +0800)
Roo/htmleditor/BlockFigure.js

index 238d129..9fe35bf 100644 (file)
@@ -397,22 +397,23 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
         this.image_src = this.getVal(node, 'img', 'src');
          
         this.align = this.getVal(node, 'figure', 'align');
-        
-        /// not really used - as hidden captions do not store the content here..
-        var figcaption = this.getVal(node, 'figcaption', false);
-        if (figcaption !== '') {
-            this.caption = this.getVal(figcaption, 'i', 'html');
-        }
-        
 
+        // data-display is stored in figure
         this.caption_display = this.getVal(node, 'figure', 'data-display');
-        Roo.log('CAPTION DISPLAY');
-        Roo.log(this.caption_display);
+
+        // backward compatible
+        // it was stored in figcaption
         if(this.caption_display == '') {
             this.caption_display = this.getVal(node, 'figcaption', 'data-display');
-            Roo.log(this.caption_display);
         }
 
+        /// not really used - as hidden captions do not store the content here..
+        var figcaption = this.getVal(node, 'figcaption', false);
+        if (figcaption !== '') {
+            this.caption = this.getVal(figcaption, 'i', 'html');
+        }
+                
+
         var dc = this.getVal(node, true, 'data-caption');
         if (this.caption_display == 'none' && figcaption != '' && dc && dc.length) {
             this.caption = dc;