aboutsummaryrefslogtreecommitdiffstats
path: root/src/jqLite.js
diff options
context:
space:
mode:
authorMisko Hevery2010-04-19 14:36:41 -0700
committerMisko Hevery2010-04-19 14:36:41 -0700
commit618a2b423d826ab8366a6907e71a4af0e76d6211 (patch)
tree5afbd982d7ae021031391f5c663d6a6c90424863 /src/jqLite.js
parent8e1b670d5b262f70fdbf4c4b01d3109d54a12ac5 (diff)
downloadangular.js-618a2b423d826ab8366a6907e71a4af0e76d6211.tar.bz2
ie fixes
Diffstat (limited to 'src/jqLite.js')
-rw-r--r--src/jqLite.js22
1 files changed, 19 insertions, 3 deletions
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);
+ }
+ });
+};