[Pkg-javascript-commits] [dojo] 10/21: Updating the example for addOnUnload to AMD syntax.

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 17:39:53 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 1.9.2
in repository dojo.

commit 34455d2b580037b0d09987947f0c08ceb911fa32
Author: celikmus <celikmus at gmail.com>
Date:   Tue Oct 1 02:50:20 2013 +0000

    Updating the example for addOnUnload to AMD syntax.
    
    Refs #17468.
    
    (cherry picked from commit 4639b70e478252f1b16f6101c6567de839e23bc2)
---
 _base/unload.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/_base/unload.js b/_base/unload.js
index 60a9a7e..064b561 100644
--- a/_base/unload.js
+++ b/_base/unload.js
@@ -66,9 +66,13 @@ var unload = {
 		//		browsers from using a "fast back" cache to make page
 		//		loading via back button instantaneous.
 		// example:
-		//	|	dojo.addOnUnload(functionPointer)
-		//	|	dojo.addOnUnload(object, "functionName")
-		//	|	dojo.addOnUnload(object, function(){ /* ... */});
+		//	|	var afunc = function() {console.log("global function");};
+		//	|	require(["dojo/_base/unload"], function(unload) {
+		//	|		var foo = {unload: function(){ console.log("unloading...");}, data: "mydata"};
+		//	|		unload.addOnUnload(afunc);
+		//	|		unload.addOnUnload(foo, "unload");
+		//	|		unload.addOnUnload(foo, function(){console.log("", this.data);});
+		//	|	});
 
 		on(win, "beforeunload", lang.hitch(obj, functionName));
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list