From a48addb67cf0b3b4d75077622b919bc5d8274e67 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Fri, 16 Jan 2015 17:30:53 +0300 Subject: [PATCH] fixes for ie8 --- js/hinter.js | 2 +- js/util.js | 4 ++-- template/en/default/index.html.tmpl | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/js/hinter.js b/js/hinter.js index 836a9a669..f35587f06 100644 --- a/js/hinter.js +++ b/js/hinter.js @@ -130,7 +130,7 @@ SimpleAutocomplete.prototype.init = function() t.style.display = 'none'; t.style.position = 'absolute'; t.style.zIndex = 1000; - document.body.appendChild(t); + document.body.insertBefore(t, document.body.childNodes[0]); } else { diff --git a/js/util.js b/js/util.js index ab2c9e7a2..d7358ddff 100644 --- a/js/util.js +++ b/js/util.js @@ -289,7 +289,7 @@ window.eventTarget = function(ev) */ window.addClass = function(obj, c) { - if (typeof(obj) == 'object' && (obj instanceof Array)) + if (obj !== null && (obj instanceof Array)) // ie8 needs explicit check for null here O_o { for (var i = 0; i < obj.length; i++) addClass(obj[i], c); @@ -302,7 +302,7 @@ window.addClass = function(obj, c) }; window.removeClass = function(obj, c) { - if (typeof(obj) == 'object' && (obj instanceof Array)) + if (obj !== null && (obj instanceof Array)) { for (var i = 0; i < obj.length; i++) removeClass(obj[i], c); diff --git a/template/en/default/index.html.tmpl b/template/en/default/index.html.tmpl index acee8197b..03d3bf580 100644 --- a/template/en/default/index.html.tmpl +++ b/template/en/default/index.html.tmpl @@ -37,7 +37,8 @@