roojs-bootstrap.js
authorAlan <alan@roojs.com>
Thu, 16 Feb 2023 08:09:13 +0000 (16:09 +0800)
committerAlan <alan@roojs.com>
Thu, 16 Feb 2023 08:09:13 +0000 (16:09 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index ea7da68..5816acf 100644 (file)
@@ -33208,6 +33208,8 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp
                 selection.removeAllRanges();
                 selection.addRange(range);
                 this.updateToolbar(null, null, null);
+                this.editorcore.fireEditorEvent(false);
+                return;
             }   
              
         }
index 04f9bd3..3568218 100644 (file)
@@ -1427,9 +1427,10 @@ C.each(function(e){if(e.enableToggle&&e.cmd){E=E||(['align-left','align-right','
 }else if(B&&B.closest('[data-block]')){db=B.closest('[data-block]');}var H=false;if(db&&this.editorcore.enableBlocks){H=Roo.htmleditor.Block.factory(db);if(H){db.className=(db.classList.length>0?db.className+' ':'')+'roo-ed-selection';B=this.selectedNode=db;
 }}var tn=B&&B.tagName.toUpperCase()||'';if(!H&&B&&tn!='A'){var I=B.closest('A');if(I){B=I;}}C.get('link').setActive(tn=='A'&&this.selectedNode.hasAttribute('href'));Roo.bootstrap.menu.Manager.hideAll();Array.from(this.editorcore.doc.body.querySelectorAll('.roo-ed-selection')).forEach(function(e){e.classList.remove('roo-ed-selection');
 });if(E||(tn.length&&tn=='BODY')){this.deleteBtn.hide();return;}this.deleteBtn.show();},onFirstFocus:function(){this.buttons.each(function(A){A.enable();});},onDelete:function(){var A=this.editorcore.createRange();var B=this.editorcore.getSelection();var sn=this.selectedNode;
-A.setStart(sn,0);A.setEnd(sn,0);if(sn.hasAttribute('data-block')){var C=Roo.htmleditor.Block.factory(this.selectedNode);if(C){C.removeNode();B.removeAllRanges();B.addRange(A);this.updateToolbar(null,null,null);}}if(!sn){return;}if(sn&&sn.tagName=='BODY'){return;
-}var D=sn.childNodes[0]||sn.nextSibling||sn.previousSibling||sn.parentNode;a=new Roo.htmleditor.FilterKeepChildren({tag:false});a.replaceTag(sn);B.removeAllRanges();B.addRange(A);this.editorcore.fireEditorEvent(false);},toggleSourceEdit:function(A){if(A){Roo.log("disabling buttons");
-this.buttons.each(function(B){if(B.cmd!='pencil'){B.disable();}});}else{Roo.log("enabling buttons");if(this.editorcore.initialized){this.buttons.each(function(B){B.enable();});}}Roo.log("calling toggole on editor");this.editor.toggleSourceEdit(A);}});
+A.setStart(sn,0);A.setEnd(sn,0);if(sn.hasAttribute('data-block')){var C=Roo.htmleditor.Block.factory(this.selectedNode);if(C){C.removeNode();B.removeAllRanges();B.addRange(A);this.updateToolbar(null,null,null);this.editorcore.fireEditorEvent(false);return;
+}}if(!sn){return;}if(sn&&sn.tagName=='BODY'){return;}var D=sn.childNodes[0]||sn.nextSibling||sn.previousSibling||sn.parentNode;a=new Roo.htmleditor.FilterKeepChildren({tag:false});a.replaceTag(sn);B.removeAllRanges();B.addRange(A);this.editorcore.fireEditorEvent(false);
+},toggleSourceEdit:function(A){if(A){Roo.log("disabling buttons");this.buttons.each(function(B){if(B.cmd!='pencil'){B.disable();}});}else{Roo.log("enabling buttons");if(this.editorcore.initialized){this.buttons.each(function(B){B.enable();});}}Roo.log("calling toggole on editor");
+this.editor.toggleSourceEdit(A);}});
 // Roo/bootstrap/form/HtmlEditorToolbar/Context.js
 Roo.bootstrap.form.HtmlEditorToolbar.Context=function(A){Roo.apply(this,A);Roo.bootstrap.form.HtmlEditorToolbar.Context.superclass.constructor.call(this,A);this.editor=A.editor;this.editorcore=A.editor.editorcore;this.buttons=new Roo.util.MixedCollection(false,function(o){return o.cmd;
 });};Roo.bootstrap.form.HtmlEditorToolbar.Context.types={'IMG':[{name:'width',title:"Width",width:40},{name:'height',title:"Height",width:40},{name:'align',title:"Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80},{name:'border',title:"Border",width:40}