| 1 |
define([ |
| 2 |
"./_WidgetBase", |
| 3 |
"./_TemplatedMixin", |
| 4 |
"./_WidgetsInTemplateMixin", |
| 5 |
"dojo/_base/array", |
| 6 |
"dojo/_base/declare", |
| 7 |
"dojo/_base/lang", |
| 8 |
"dojo/_base/kernel" |
| 9 |
], function(_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, array, declare, lang, kernel){ |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
lang.extend(_WidgetBase, { |
| 19 |
waiRole: "", |
| 20 |
waiState:"" |
| 21 |
}); |
| 22 |
|
| 23 |
return declare("dijit._Templated", [_TemplatedMixin, _WidgetsInTemplateMixin], { |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
constructor: function(){ |
| 29 |
kernel.deprecated(this.declaredClass + ": dijit._Templated deprecated, use dijit._TemplatedMixin and if necessary dijit._WidgetsInTemplateMixin", "", "2.0"); |
| 30 |
}, |
| 31 |
|
| 32 |
_processNode: function(baseNode, getAttrFunc){ |
| 33 |
var ret = this.inherited(arguments); |
| 34 |
|
| 35 |
|
| 36 |
var role = getAttrFunc(baseNode, "waiRole"); |
| 37 |
if(role){ |
| 38 |
baseNode.setAttribute("role", role); |
| 39 |
} |
| 40 |
var values = getAttrFunc(baseNode, "waiState"); |
| 41 |
if(values){ |
| 42 |
array.forEach(values.split(/\s*,\s*/), function(stateValue){ |
| 43 |
if(stateValue.indexOf('-') != -1){ |
| 44 |
var pair = stateValue.split('-'); |
| 45 |
baseNode.setAttribute("aria-"+pair[0], pair[1]); |
| 46 |
} |
| 47 |
}); |
| 48 |
} |
| 49 |
|
| 50 |
return ret; |
| 51 |
} |
| 52 |
}); |
| 53 |
}); |