You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.1 KiB
55 lines
1.1 KiB
<!DOCTYPE html> |
|
<html> |
|
<head> |
|
<meta charset="utf-8"> |
|
<title>dojo/behavior tests</title> |
|
<link rel="stylesheet" href="../../resources/dojo.css"> |
|
</head> |
|
<body> |
|
<div class="foo" id="fooOne"> |
|
<span>.foo > span</span> |
|
<div class="bar"> |
|
<span>.foo > .bar > span</span> |
|
</div> |
|
</div> |
|
|
|
<!--for focus/topic tests --> |
|
<input id="another" value="another"> |
|
<input type="text" id="blah" class="foo blah" name="thinger" value="thinger" tabIndex="0"> |
|
|
|
<script src="../../dojo.js" data-dojo-config="async: true, isDebug: true"></script> |
|
<script> |
|
var ready = false, |
|
applyCount = 0, |
|
topicCount = 0, |
|
behaviorObject = { |
|
'.bar':function(elem){ |
|
domStyle.set(elem, 'opacity', 0.5); |
|
applyCount++; |
|
}, |
|
'.foo > span':function(elem){ |
|
elem.style.fontStyle = 'italic'; |
|
applyCount++; |
|
} |
|
}, |
|
behavior, |
|
domStyle; |
|
|
|
require([ |
|
'dojo/behavior', |
|
'dojo/dom-style', |
|
'dojo/topic', |
|
'dojo/domReady!' |
|
], function (_behavior, _domStyle, topic) { |
|
behavior = _behavior; |
|
domStyle = _domStyle; |
|
|
|
topic.subscribe('/foo', function () { |
|
topicCount++; |
|
}); |
|
|
|
ready = true; |
|
}); |
|
</script> |
|
</body> |
|
</html>
|
|
|