Sha256: a687b75b42959dbbeca8fd3530504e44e19dee23ef7e7e8ed0220dac66ca455f

Contents?: true

Size: 990 Bytes

Versions: 4

Compression:

Stored size: 990 Bytes

Contents

dojo.provide("dijit._base.window");

dijit.getDocumentWindow = function(doc){
	// summary:
	// 		Get window object associated with document doc

	// In some IE versions (at least 6.0), document.parentWindow does not return a
	// reference to the real window object (maybe a copy), so we must fix it as well
	// We use IE specific execScript to attach the real window reference to
	// document._parentWindow for later use
	if(dojo.isIE && window !== document.parentWindow && !doc._parentWindow){
		/*
		In IE 6, only the variable "window" can be used to connect events (others
		may be only copies).
		*/
		doc.parentWindow.execScript("document._parentWindow = window;", "Javascript");
		//to prevent memory leak, unset it after use
		//another possibility is to add an onUnload handler which seems overkill to me (liucougar)
		var win = doc._parentWindow;
		doc._parentWindow = null;
		return win;	//	Window
	}

	return doc._parentWindow || doc.parentWindow || doc.defaultView;	//	Window
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dojo-pkg-1.120.0 data/dojo-release-1.2.0-src/dijit/_base/window.js
dojo-pkg-1.121.0 data/dojo-release-1.2.1-src/dijit/_base/window.js
dojo-pkg-1.122.0 data/dojo-release-1.2.2-src/dijit/_base/window.js
dojo-pkg-1.123.0 data/dojo-release-1.2.3-src/dijit/_base/window.js