This commit is contained in:
Misko Hevery 2010-04-19 14:36:41 -07:00
parent 8e1b670d5b
commit 618a2b423d
4 changed files with 27 additions and 8 deletions

View file

@ -118,8 +118,10 @@ function isElement(node) {
}
function isVisible(element) {
var rect = element[0].getBoundingClientRect();
return rect.width && rect.height;
var rect = element[0].getBoundingClientRect(),
width = rect.width || (rect.right||0 - rect.left||0),
height = rect.height || (rect.bottom||0 - rect.top||0);
return width>0 && height>0;
}
function map(obj, iterator, context) {

View file

@ -100,7 +100,6 @@ JQLite.prototype = {
});
},
//TODO: remove
trigger: function(type) {
var evnt = document.createEvent('MouseEvent');
evnt.initMouseEvent(type, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
@ -191,9 +190,9 @@ JQLite.prototype = {
text: function(value) {
if (isDefined(value)) {
this[0].nodeValue = value;
this[0].textContent = value;
}
return this[0].nodeValue;
return this[0].textContent;
},
val: function(value) {
@ -216,3 +215,20 @@ JQLite.prototype = {
parent: function() { return jqLite(this[0].parentNode);},
clone: function() { return jqLite(this[0].cloneNode(true)); }
};
if (msie) {
extend(JQLite.prototype, {
text: function(value) {
var e = this[0];
if (isDefined(value)) {
e.innerText = value;
}
// NodeType == 3 is text node
return e.nodeType == 3 ? e.nodeValue : e.innerText;
},
trigger: function(type) {
this[0].fireEvent('on' + type);
}
});
};

View file

@ -1 +1 @@
java -jar lib/jstestdriver/JsTestDriver.jar --tests BinderTest.testChangingSelectNonSelectedUpdatesModel
java -jar lib/jstestdriver/JsTestDriver.jar --tests BinderTest

View file

@ -77,8 +77,9 @@ function sortedHtml(element) {
for(var css in node.style){
var value = node.style[css];
if (isString(value) && isString(css) && css != 'cssText' && value && (1*css != css)) {
var text = css + ': ' + node.style[css];
if (indexOf(style, text) == -1) {
var value = node.style[css];
var text = css + ': ' + value;
if (value != 'false' && indexOf(style, text) == -1) {
style.push(text);
}
}