roojs-ui.js
authorAlan <alan@roojs.com>
Mon, 13 Dec 2021 06:46:22 +0000 (14:46 +0800)
committerAlan <alan@roojs.com>
Mon, 13 Dec 2021 06:46:22 +0000 (14:46 +0800)
roojs-ui-debug.js
roojs-all.js
roojs-debug.js
Roo/form/HtmlEditor/ToolbarContext.js

Roo/form/HtmlEditor/ToolbarContext.js
roojs-all.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index d422996..6d708e8 100644 (file)
@@ -703,14 +703,10 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
             listeners : {
                 click : function ()
                 {
+                    var sn = tb.selectedNode;
                     if (block) {
                         sn = Roo.htmleditor.Block.factory(tb.selectedNode).removalNode();
                         
-                    } else {
-                    
-                        // remove
-                        // undo does not work.
-                        var sn = tb.selectedNode;
                     }
                     if (!sn) {
                         return;
index a0ede41..40d9cb4 100644 (file)
@@ -2076,7 +2076,7 @@ if(I.optname){J=Roo.form.HtmlEditor.ToolbarContext.options[I.optname];}if(J){tb.
 b[c.attrname]=r.get('val');b.updateElement(tb.selectedNode);E.syncValue();return;}if(c.stylename){tb.selectedNode.style[c.stylename]=r.get('val');E.syncValue();return;}if(r===false){tb.selectedNode.removeAttribute(c.attrname);E.syncValue();return;}tb.selectedNode.setAttribute(c.attrname,r.get('val'));
 E.syncValue();}}}));continue;}tb.addField(new Roo.form.TextField({name:'-roo-edit-'+A[i].name,attrname:A[i].name,width:I.width,value:'',listeners:{'change':function(f,nv,ov){if(tb.selectedNode.hasAttribute('data-block')){var b=Roo.htmleditor.Block.factory(tb.selectedNode);
 b[f.attrname]=nv;b.updateElement(tb.selectedNode);E.syncValue();return;}tb.selectedNode.setAttribute(f.attrname,nv);E.syncValue();}}}));}var K=this;if(nm=='BODY'){tb.addSeparator();tb.addButton({text:'Stylesheets',listeners:{click:function(){K.editor.fireEvent('stylesheetsclick',K.editor);
-}}});}tb.addFill();tb.addButton({text:'Remove Block or Formating',listeners:{click:function(){if(C){Roo.htmleditor.Block.factory(tb.selectedNode).remove();}var sn=tb.selectedNode;if(!sn){return;}var L=sn.childNodes[0]||sn.nextSibling||sn.previousSibling||sn.parentNode;
+}}});}tb.addFill();tb.addButton({text:'Remove Block or Formating',listeners:{click:function(){var sn=tb.selectedNode;if(C){sn=Roo.htmleditor.Block.factory(tb.selectedNode).removalNode();}if(!sn){return;}var L=sn.childNodes[0]||sn.nextSibling||sn.previousSibling||sn.parentNode;
 if(sn.hasAttribute('data-block')){L=sn.nextSibling||sn.previousSibling||sn.parentNode;sn.parentNode.removeChild(sn);}else if(sn&&sn.tagName!='BODY'){a=new Roo.htmleditor.FilterKeepChildren({tag:false});a.removeTag(sn);}var M=E.createRange();M.setStart(L,0);
 M.setEnd(L,0);var N=E.getSelection();N.removeAllRanges();N.addRange(M);K.updateToolbar(null,null,null);K.updateFooter(false);}}});tb.el.on('click',function(e){e.preventDefault();});tb.el.setVisibilityMode(Roo.Element.DISPLAY);tb.el.hide();return tb;},buildFooter:function(){var A=this.editor.wrap.createChild();
 this.footer=new Roo.Toolbar(A);var B=new Roo.Toolbar.Fill();var _t=this;this.footer.add({text:'&lt;',xtype:'Button',handler:function(){_t.footDisp.scrollTo('left',0,true)}});this.footer.add(B);this.footer.add({text:'&gt;',xtype:'Button',handler:function(){_t.footDisp.select('span').last().scrollIntoView(_t.footDisp,true);
index 613def5..dd57fe8 100644 (file)
@@ -49786,13 +49786,11 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
             listeners : {
                 click : function ()
                 {
+                    var sn = tb.selectedNode;
                     if (block) {
-                        Roo.htmleditor.Block.factory(tb.selectedNode).remove();
+                        sn = Roo.htmleditor.Block.factory(tb.selectedNode).removalNode();
+                        
                     }
-                    
-                    // remove
-                    // undo does not work.
-                    var sn = tb.selectedNode;
                     if (!sn) {
                         return;
                     }
index 561d56a..f0cee80 100644 (file)
@@ -25799,13 +25799,11 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
             listeners : {
                 click : function ()
                 {
+                    var sn = tb.selectedNode;
                     if (block) {
-                        Roo.htmleditor.Block.factory(tb.selectedNode).remove();
+                        sn = Roo.htmleditor.Block.factory(tb.selectedNode).removalNode();
+                        
                     }
-                    
-                    // remove
-                    // undo does not work.
-                    var sn = tb.selectedNode;
                     if (!sn) {
                         return;
                     }
index 51dab86..e77c4ef 100644 (file)
@@ -1152,7 +1152,7 @@ if(I.optname){J=Roo.form.HtmlEditor.ToolbarContext.options[I.optname];}if(J){tb.
 b[c.attrname]=r.get('val');b.updateElement(tb.selectedNode);E.syncValue();return;}if(c.stylename){tb.selectedNode.style[c.stylename]=r.get('val');E.syncValue();return;}if(r===false){tb.selectedNode.removeAttribute(c.attrname);E.syncValue();return;}tb.selectedNode.setAttribute(c.attrname,r.get('val'));
 E.syncValue();}}}));continue;}tb.addField(new Roo.form.TextField({name:'-roo-edit-'+A[i].name,attrname:A[i].name,width:I.width,value:'',listeners:{'change':function(f,nv,ov){if(tb.selectedNode.hasAttribute('data-block')){var b=Roo.htmleditor.Block.factory(tb.selectedNode);
 b[f.attrname]=nv;b.updateElement(tb.selectedNode);E.syncValue();return;}tb.selectedNode.setAttribute(f.attrname,nv);E.syncValue();}}}));}var K=this;if(nm=='BODY'){tb.addSeparator();tb.addButton({text:'Stylesheets',listeners:{click:function(){K.editor.fireEvent('stylesheetsclick',K.editor);
-}}});}tb.addFill();tb.addButton({text:'Remove Block or Formating',listeners:{click:function(){if(C){Roo.htmleditor.Block.factory(tb.selectedNode).remove();}var sn=tb.selectedNode;if(!sn){return;}var L=sn.childNodes[0]||sn.nextSibling||sn.previousSibling||sn.parentNode;
+}}});}tb.addFill();tb.addButton({text:'Remove Block or Formating',listeners:{click:function(){var sn=tb.selectedNode;if(C){sn=Roo.htmleditor.Block.factory(tb.selectedNode).removalNode();}if(!sn){return;}var L=sn.childNodes[0]||sn.nextSibling||sn.previousSibling||sn.parentNode;
 if(sn.hasAttribute('data-block')){L=sn.nextSibling||sn.previousSibling||sn.parentNode;sn.parentNode.removeChild(sn);}else if(sn&&sn.tagName!='BODY'){a=new Roo.htmleditor.FilterKeepChildren({tag:false});a.removeTag(sn);}var M=E.createRange();M.setStart(L,0);
 M.setEnd(L,0);var N=E.getSelection();N.removeAllRanges();N.addRange(M);K.updateToolbar(null,null,null);K.updateFooter(false);}}});tb.el.on('click',function(e){e.preventDefault();});tb.el.setVisibilityMode(Roo.Element.DISPLAY);tb.el.hide();return tb;},buildFooter:function(){var A=this.editor.wrap.createChild();
 this.footer=new Roo.Toolbar(A);var B=new Roo.Toolbar.Fill();var _t=this;this.footer.add({text:'&lt;',xtype:'Button',handler:function(){_t.footDisp.scrollTo('left',0,true)}});this.footer.add(B);this.footer.add({text:'&gt;',xtype:'Button',handler:function(){_t.footDisp.select('span').last().scrollIntoView(_t.footDisp,true);