Ticket #2018: 2018_pre.patch
| File 2018_pre.patch, 1.7 KB (added by martinkou, 2 years ago) |
|---|
-
editor/_source/fckeditorapi.js
95 95 '}' + 96 96 'this.StartNext();' + 97 97 '}' + 98 '}' + 98 '},' + 99 100 '_UnloadList : [],' + 101 102 '_UnloadInstanceInner : function()' + 103 '{' + 104 'var name = FCKeditorAPI._UnloadList.shift(), el = null ;' + 105 'if ( ! ( el = document.getElementById( "_FCKInstance_" + name ) ) )' + 106 'delete FCKeditorAPI.Instances[name] ;' + 107 'else ' + 108 'el.removeAttribute( "id" ) ;' + 109 '},' + 110 111 '_UnloadInstance : function( name, iframe )' + 112 '{' + 113 'this._UnloadList.push( name ) ;' + 114 'iframe.id = "_FCKInstance_" + name ;' + 115 'this._Root.setTimeout( this._Root.FCKeditorAPI._UnloadInstanceInner, 100 ) ;' + 116 '},' + 117 118 '_Root : window' + 99 119 '}' ; 100 120 101 121 // In IE, the "eval" function is not always available (it works with … … 162 182 } 163 183 } 164 184 185 // Keep a reference to the frameElement so that it doesn't get deleted in FF3 when we need to check it at unload. 186 if ( FCKBrowserInfo.IsGecko ) 187 window._FCK_frameElement = frameElement ; 165 188 function FCKeditorAPI_Cleanup() 166 189 { 167 if ( ! window.FCKUnloadFlag ) 168 return ; 169 delete FCKeditorAPI.Instances[ FCK.Name ] ; 190 FCKeditorAPI._UnloadInstance( FCK.Name, window._FCK_frameElement || window.frameElement ) ; 170 191 } 171 function FCKeditorAPI_ConfirmCleanup()172 {173 window.FCKUnloadFlag = true ;174 }175 192 FCKTools.AddEventListener( window, 'unload', FCKeditorAPI_Cleanup ) ; 176 FCKTools.AddEventListener( window, 'beforeunload', FCKeditorAPI_ConfirmCleanup) ;