Re: The Cut effect for custom buttons

  •  05-24-2010, 11:14 PM

    Re: The Cut effect for custom buttons

    Found the reason: the onselectionchange event was removed between switching to code view and normal view. I'm using a workaround:
     
    1. var tabEditOnCommandRunning = false;    
    2. function CuteEditor_OnCommand(editor, command, ui, value) {    
    3.     if (command.toLowerCase() == 'tabedit') {    
    4.         if (tabEditOnCommandRunning) return false;    
    5.         tabEditOnCommandRunning = true;    
    6.         editor.ExecCommand(command, ui, value);    
    7.         var editdoc = editor.GetDocument();    
    8.         if (editdoc.attachEvent)    
    9.             editdoc.attachEvent('onselectionchange'function(event) { ... });   
    10.         else if (editdoc.addEventListener)    
    11.             editdoc.addEventListener('selectionchange'function(event) { ... }, true);   
    12.         tabEditOnCommandRunning = false;    
    13.         return true;       
    14.     }   
    15. }  
     
    so it works now. I'm not too sure if you guys think this is a bug/ unsupported feature, but I'm leaning towards bug.
     
     
     
View Complete Thread