Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2150 mathias 1
if(!dojo._hasResource["dojo.NodeList-fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2
dojo._hasResource["dojo.NodeList-fx"] = true;
3
dojo.provide("dojo.NodeList-fx");
4
dojo.require("dojo.fx");
5
 
6
dojo.extend(dojo.NodeList, {
7
	_anim: function(obj, method, args){
8
		var anims = [];
9
		args = args||{};
10
		this.forEach(function(item){
11
			var tmpArgs = { node: item };
12
			dojo.mixin(tmpArgs, args);
13
			anims.push(obj[method](tmpArgs));
14
		});
15
		return dojo.fx.combine(anims); // dojo._Animation
16
	},
17
 
18
	wipeIn: function(args){
19
		//	summary:
20
		//		wipe in all elements of this NodeList. Returns an instance of dojo._Animation
21
		//	example:
22
		//		Fade in all tables with class "blah":
23
		//		|	dojo.query("table.blah").wipeIn().play();
24
		return this._anim(dojo.fx, "wipeIn", args); // dojo._Animation
25
	},
26
 
27
	wipeOut: function(args){
28
		//	summary:
29
		//		wipe out all elements of this NodeList. Returns an instance of dojo._Animation
30
		//	example:
31
		//		Wipe out all tables with class "blah":
32
		//		|	dojo.query("table.blah").wipeOut().play();
33
		return this._anim(dojo.fx, "wipeOut", args); // dojo._Animation
34
	},
35
 
36
	slideTo: function(args){
37
		//	summary:
38
		//		slide all elements of the node list to the specified place.
39
		//		Returns an instance of dojo._Animation
40
		//	example:
41
		//		|	Move all tables with class "blah" to 300/300:
42
		//		|	dojo.query("table.blah").slideTo({
43
		//		|		left: 40,
44
		//		|		top: 50
45
		//		|	}).play();
46
		return this._anim(dojo.fx, "slideTo", args); // dojo._Animation
47
	},
48
 
49
 
50
	fadeIn: function(args){
51
		//	summary:
52
		//		fade in all elements of this NodeList. Returns an instance of dojo._Animation
53
		//	example:
54
		//		Fade in all tables with class "blah":
55
		//		|	dojo.query("table.blah").fadeIn().play();
56
		return this._anim(dojo, "fadeIn", args); // dojo._Animation
57
	},
58
 
59
	fadeOut: function(args){
60
		//	summary:
61
		//		fade out all elements of this NodeList. Returns an instance of dojo._Animation
62
		//	example:
63
		//		Fade out all elements with class "zork":
64
		//		|	dojo.query(".zork").fadeOut().play();
65
		//	example:
66
		//		Fade them on a delay and do something at the end:
67
		//		|	var fo = dojo.query(".zork").fadeOut();
68
		//		|	dojo.connect(fo, "onEnd", function(){ /*...*/ });
69
		//		|	fo.play();
70
		return this._anim(dojo, "fadeOut", args); // dojo._Animation
71
	},
72
 
73
	animateProperty: function(args){
74
		//	summary:
75
		//		see dojo.animateProperty(). Animate all elements of this
76
		//		NodeList across the properties specified.
77
		//	example:
78
		//	|	dojo.query(".zork").animateProperty({
79
		//	|		duration: 500,
80
		//	|		properties: {
81
		//	|			color:		{ start: "black", end: "white" },
82
		//	|			left:		{ end: 300 }
83
		//	|		}
84
		//	|	}).play();
85
		return this._anim(dojo, "animateProperty", args); // dojo._Animation
86
	}
87
});
88
 
89
}