summaryrefslogtreecommitdiff
path: root/js/dojo/dojox/fx/ext-dojo/NodeList-style.js
blob: 10f4442f5c09e483f6e56f3f6b12ddb923fc196e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//>>built
define("dojox/fx/ext-dojo/NodeList-style", ["dojo/_base/lang", "dojo/_base/NodeList","dojo/NodeList-fx", "dojo/fx", "../style"],
	function(lang, NodeList, NodeListFx, coreFx, styleX){
// summary:
//		Core extensions to `dojo.NodeList` providing additional fx to `dojo.NodeList-fx`
// 		from `dojox.fx.style`
//
// description:
//		A Package to extend dojo base NodeList with fx provided by the `dojox.fx` project.
//		These are experimental animations, in an experimental


lang.extend( NodeList, {

	addClassFx: function(cssClass, args){
		// 	summary:
		//		Animate the effects of adding a class to all nodes in this list.
		//		see `dojox.fx.addClass`
		//
		//	tags: FX, NodeList
		//
		//	example:
		//	|	// fade all elements with class "bar" to to 50% opacity
		//	|	dojo.query(".bar").addClassFx("bar").play();

		return coreFx.combine(this.map(function(n){ // dojo.Animation
			return styleX.addClass(n, cssClass, args);
		}));
	},
	
	removeClassFx: function(cssClass, args){
		// summary:
		//		Animate the effect of removing a class to all nodes in this list.
		//		see `dojox.fx.removeClass`
		//
		//	tags: FX, NodeList
		//
		// example:
		//	| dojo.query(".box").removeClassFx("bar").play();

		return coreFx.combine(this.map(function(n){ // dojo.Animation
			return styleX.removeClass(n, cssClass, args);
		}));
	},
	
	toggleClassFx: function(cssClass, force, args){
		// summary:
		//		Animate the effect of adding or removing a class to all nodes in this list.
		//		see `dojox.fx.toggleClass`
		//
		//	tags: FX, NodeList
		//
		// example:
		//	| dojo.query(".box").toggleClass("bar").play();

		return coreFx.combine(this.map(function(n){ // dojo.Animation
			return styleX.toggleClass(n, cssClass, force, args);
		}));
	}
});
return NodeList;
});