-
Notifications
You must be signed in to change notification settings - Fork 5
/
experimental.js
44 lines (37 loc) · 1.13 KB
/
experimental.js
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
define(["dojo", "dijit"], function(dojo, dijit){
var d = dojo, dij = dijit;
d._nop = function(){
// summary: A global null-op function to reused in all null operations situations requiring a function
//
// example:
// | my.workAround = dojo.isIE ? function(){ /* janky */ } : dojo._nop;
//
}
d._nopReturn = function(){
// summary: A global no-op function, like `dojo._nop`, but for use
// in `dojo.NodeList` no-op situations where the context needs
// to be returned for forther chaining.
//
// example:
// Create a safe-NodeList function for an IE-specific issue
// | dojo.extend(dojo.NodeList, {
// | janky: dojo.isIE ? function(){ /* workaround */ } : d._nopReturn
// | });
return this; // Anything
}
d.extend(d.NodeList, {
widget: function(){
// summary: Get a list of widget's from the nodes, retuning a new
// NodeList of the widget's .domNode property.
//
// example:
// | dojo.query("[dojoType]").widget().forEach(..).end();
var nl = new d.NodeList();
this.forEach(function(n){
nl.push(dij.getEnclosingWidget(n).domNode);
});
return nl;
}
});
return d;
});