Ticket #6284: within.harobed.patch
| File within.harobed.patch, 1.2 kB (added by harobed, 10 months ago) |
|---|
-
dojo/_base/html.js
946 946 mb.y = abs.y; 947 947 return mb; 948 948 } 949 950 dojo.within = function(/*DomNode|String*/node, x, y) { 951 return (y >= node.offsetTop && 952 y < node.offsetTop + node.offsetHeight && 953 x >= node.offsetLeft && 954 x < node.offsetLeft + node.offsetWidth); 955 } 949 956 })(); 950 957 951 958 // ============================= -
dojo/tests/_base/html.html
194 194 t.assertFalse(dojo.hasClass(node, "b")); 195 195 dojo.removeClass(node, "c"); 196 196 t.assertTrue(!node.className); 197 } 197 }, 198 function testWithinFunction(t){ 199 t.assertTrue(dojo.within(dojo.byId('sq100'), 150, 150)); 200 t.assertFalse(dojo.within(dojo.byId('sq100'), 250, 150)); 201 } 198 202 ] 199 203 ); 200 204 doh.run();