Roo/htmleditor/BlockFigure.js
authorAlan <alan@roojs.com>
Wed, 29 Sep 2021 09:21:48 +0000 (17:21 +0800)
committerAlan <alan@roojs.com>
Wed, 29 Sep 2021 09:21:48 +0000 (17:21 +0800)
Roo/htmleditor/BlockFigure.js

index 4a0c378..cb76ae8 100644 (file)
@@ -29,8 +29,8 @@ Roo.htmleditor.BlockFigure = function(cfg)
     }
     Roo.apply(this, cfg);
 }
-
-Roo.htmleditor.BlockFigure.prototype = {
+Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
     
     // setable values.
     image_src: '',
@@ -43,6 +43,7 @@ Roo.htmleditor.BlockFigure.prototype = {
     image_height : '',
     
     // used by context menu
+    friendly_name : 'Image with caption',
     
     context : { // ?? static really
         image_width : {
@@ -112,43 +113,14 @@ Roo.htmleditor.BlockFigure.prototype = {
         this.align = this.getVal(node, 'figure', 'style', 'text-align');
         this.caption = this.getVal(node, 'figcaption', 'html');
         this.text_align = this.getVal(node, 'figcaption', 'style','text-align');
-    },
+    } 
     
-    updateElement : function(node)
-    {
-        Roo.DomHelper.overwrite(node, this.toObject());
-    },
-    /**
-     * convert to plain HTML for calling insertAtCursor..
-     */
-    toHTML : function()
-    {
-        return Roo.DomHelper.markup(this.toObject());
-    },
+  
+   
+     
     
-    getVal : function(node, tag, attr, style)
-    {
-        var n = node;
-        if (n.tagName != tag.toUpperCase()) {
-            // in theory we could do figure[3] << 3rd figure? or some more complex search..?
-            // but kiss for now.
-            n = node.getElementsByTagName(tag).item(0);
-        }
-        if (attr == 'html') {
-            return n.innerHTML;
-        }
-        if (attr == 'style') {
-            return Roo.get(n).getStyle(style);
-        }
-        
-        return Roo.get(n).attr(attr);
-            
-    }
     
     
     
-    
-    
-    
-}
+})