Feature #16813

JSeventFuncCalls onunload

Added by Christoph Koehler almost 13 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2006-12-26
Due date:
% Done:

0%

PHP Version:
5
Tags:
Complexity:
Sprint Focus:

Description

onunload didn't work with JSeventFunCalls but might be required, for example with Google Maps to fix some memory leaks with IE.
Attached is a patch that adds that feature just like onload:
$GLOBALS["TSFE"]->JSeventFuncCalls["onunload"][tx_bla]="GUnload();";

(issue imported from #M4701)

jseventunload.patch View (1.47 KB) Administrator Admin, 2006-12-26 21:31

jseventunload-new.patch View (1.37 KB) Administrator Admin, 2006-12-28 11:22

events.diff View (3.25 KB) Administrator Admin, 2007-02-03 14:01


Related issues

Duplicates TYPO3 Core - Bug #16229: onunload missing in JSeventFuncCalls Closed 2006-06-12

History

#1 Updated by Christoph Koehler almost 13 years ago

Uploaded new patch, the old one wasn't quite right, so just ignore that one. Sorry about that!

#2 Updated by Martin Kutschker over 12 years ago

Added a new patch which allows for arbitrary events.

#3 Updated by Christoph Koehler over 12 years ago

Thanks Martin. I saw the duplicate load call and your comment whether it was necessary, and I am all for removing it. One should be enough.

#4 Updated by Martin Kutschker over 12 years ago

More questions:

Should we change from document.onXXX to window.onXXX? onload and onunload belong to window not document, but others should stay with document.

OTOH the developer could simply use event listeners.

#5 Updated by Christoph Koehler over 12 years ago

Not sure since both are valid and I am not a JS guy. I use it for Google Maps which requires the onload stuff to be in the body tag. So as long as I can still do that, I am good.
If they are different (couldn't find anything on Google about that), we could just add them as an option instead of including them all the time automatically.

#6 Updated by Oliver Hader over 12 years ago

Have a look how this is implemented in prototype.js event handlers ("_observeAndCache"):
http://dev.rubyonrails.org/browser/spinoffs/prototype/trunk/src/event.js#L61

#7 Updated by Martin Kutschker over 12 years ago

My point was not how, but if we should use evebt listeners.

#8 Updated by Oliver Hader over 12 years ago

Okay :) IMHO we should use event listeners.

#9 Updated by Michael Stucki over 12 years ago

Fixed in TYPO3 4.1RC2

#10 Updated by Oliver Hader over 12 years ago

Committed to Trunk

Also available in: Atom PDF