mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
ie fixes
This commit is contained in:
parent
8e1b670d5b
commit
618a2b423d
4 changed files with 27 additions and 8 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
2
test.sh
2
test.sh
|
|
@ -1 +1 @@
|
|||
java -jar lib/jstestdriver/JsTestDriver.jar --tests BinderTest.testChangingSelectNonSelectedUpdatesModel
|
||||
java -jar lib/jstestdriver/JsTestDriver.jar --tests BinderTest
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue