aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Angular.js6
-rw-r--r--src/jqLite.js22
2 files changed, 23 insertions, 5 deletions
diff --git a/src/Angular.js b/src/Angular.js
index ec1fa49b..94853004 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -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) {
diff --git a/src/jqLite.js b/src/jqLite.js
index 67e1717c..4dcd9349 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -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);
+ }
+ });
+};