Version 5.0.0 beta 3
This commit is contained in:
1 parent
f61b0da85d
commit
e86153356a
108 files changed
+2927
-1573
No files matched your search
@@ -697,8 +697,7 @@ setTimeout(()=>fillTextarea())
|
||||
setTimeout(()=>{try{$(elem).get(0).dispatchEvent(new CustomEvent("ips:editorAfterInit",{bubbles:true,cancelable:false,detail:{elem:$(elem).get(0),textArea,content:textArea.innerText,options:config,instance}}));}catch(e){e.meessage="Something went wrong dispatching ips:editorAfterInit event on the page:\n"+e.message;Debug.error(e);}
|
||||
fillTextarea();},100)}
|
||||
const onTransaction=config.onTransaction;config.onTransaction=_.debounce(function(...args){instance=instance||args[0]?.editor;fillTextarea();try{onTransaction?.call?.(this,...args);}catch(e){e.message="Something went wrong in an onTransaction call to the editor"+e.message;Debug.error(e);}},200,{leading:false,trailing:true});const onUpdate=config.onUpdate;config.onUpdate=function(...args){try{onUpdate?.call?.(this,...args);}catch(e){e.message="Failed to run the onUpdate event listener:\n"+e.message;Debug.error(e);}
|
||||
instance=instance||args[0]?.editor;console.log(instance,instance.getJSON())
|
||||
config.onTransaction?.cancel();setTimeout(()=>{let canceled=false;const event=new CustomEvent('ips:editorUpdated',{bubbles:true,cancelable:true,detail:{elem:$(elem).get(0),textArea,instance,}});throttledComposeEvent();const origStopProp=event.stopPropagation;const origStopImmProp=event.stopImmediatePropagation;event.stopPropagation=(function(){canceled=true;origStopProp();}).bind(event)
|
||||
instance=instance||args[0]?.editor;config.onTransaction?.cancel();setTimeout(()=>{let canceled=false;const event=new CustomEvent('ips:editorUpdated',{bubbles:true,cancelable:true,detail:{elem:$(elem).get(0),textArea,instance,}});throttledComposeEvent();const origStopProp=event.stopPropagation;const origStopImmProp=event.stopImmediatePropagation;event.stopPropagation=(function(){canceled=true;origStopProp();}).bind(event)
|
||||
event.stopImmediatePropagation=(function(){canceled=true;origStopImmProp();}).bind(event);$(elem).get(0).dispatchEvent(event)
|
||||
if(canceled){return;}
|
||||
fillTextarea()})}
|
||||
|
||||
Reference in new issue
Block a user