summaryrefslogtreecommitdiff
path: root/js/dojo-1.6/dojox/fx/ext-dojo/NodeList-style.js
blob: cf055551ccc5545ce5e8dd98a28ca342d712b54d (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
63
64
65
66
67
68
69
70
71
72
73
/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


if(!dojo._hasResource["dojox.fx.ext-dojo.NodeList-style"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojox.fx.ext-dojo.NodeList-style"] = true;
dojo.provide("dojox.fx.ext-dojo.NodeList-style");
dojo.experimental("dojox.fx.ext-dojo.NodeList-style");
// summary:
//		Core extensions to `dojo.NodeList` providing addtional 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

dojo.require("dojo.NodeList-fx");
dojo.require("dojox.fx.style");

dojo.extend(dojo.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 dojo.fx.combine(this.map(function(n){ // dojo.Animation
			return dojox.fx.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 dojo.fx.combine(this.map(function(n){ // dojo.Animation
			return dojox.fx.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 dojo.fx.combine(this.map(function(n){ // dojo.Animation
			return dojox.fx.toggleClass(n, cssClass, force, args);
		}));
	}

});

}