[Pkg-javascript-commits] [sockjs-client] 382/434: Let the iframe / htmlfile code use our new unload_add hooks.
Tonnerre Lombard
tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:27 UTC 2014
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch master
in repository sockjs-client.
commit 323c42dd8c45feed3a62c7c0f02a17f6deec6b82
Author: Marek Majkowski <majek04 at gmail.com>
Date: Fri Apr 13 16:05:45 2012 +0100
Let the iframe / htmlfile code use our new unload_add hooks.
---
lib/dom.js | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/dom.js b/lib/dom.js
index 9ca18e9..f813875 100644
--- a/lib/dom.js
+++ b/lib/dom.js
@@ -83,7 +83,7 @@ utils.unload_del = function(ref) {
utils.createIframe = function (iframe_url, error_callback) {
var iframe = _document.createElement('iframe');
- var tref;
+ var tref, unload_ref;
var unattach = function() {
clearTimeout(tref);
// Explorer had problems with that.
@@ -108,7 +108,7 @@ utils.createIframe = function (iframe_url, error_callback) {
}
iframe = null;
}, 0);
- utils.detachEvent('unload', cleanup);
+ utils.unload_del(unload_ref);
}
};
var onerror = function(r) {
@@ -139,7 +139,7 @@ utils.createIframe = function (iframe_url, error_callback) {
};
_document.body.appendChild(iframe);
tref = setTimeout(function(){onerror('timeout');}, 5000);
- utils.attachEvent('unload', cleanup);
+ unload_ref = utils.unload_add(cleanup);
return {
post: post,
cleanup: cleanup,
@@ -149,7 +149,7 @@ utils.createIframe = function (iframe_url, error_callback) {
utils.createHtmlfile = function (iframe_url, error_callback) {
var doc = new ActiveXObject('htmlfile');
- var tref;
+ var tref, unload_ref;
var iframe;
var unattach = function() {
clearTimeout(tref);
@@ -157,7 +157,7 @@ utils.createHtmlfile = function (iframe_url, error_callback) {
var cleanup = function() {
if (doc) {
unattach();
- utils.detachEvent('unload', cleanup);
+ utils.unload_del(unload_ref);
if('ActiveXObject' in _window) {
try {
iframe.src = "about:blank";
@@ -196,7 +196,7 @@ utils.createHtmlfile = function (iframe_url, error_callback) {
c.appendChild(iframe);
iframe.src = iframe_url;
tref = setTimeout(function(){onerror('timeout');}, 5000);
- utils.attachEvent('unload', cleanup);
+ unload_ref = utils.unload_add(cleanup);
return {
post: post,
cleanup: cleanup,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git
More information about the Pkg-javascript-commits
mailing list