Mercurial > kallithea
changeset 2787:423a14349ef3 beta
Don't use .innerHTML for tr field, I'm looking at you IE
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Mon, 03 Sep 2012 17:33:21 +0200 |
parents | ffaaeb5a5a69 |
children | 2d6d6c346f66 |
files | rhodecode/public/js/rhodecode.js |
diffstat | 1 files changed, 11 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/public/js/rhodecode.js Mon Sep 03 17:22:33 2012 +0200 +++ b/rhodecode/public/js/rhodecode.js Mon Sep 03 17:33:21 2012 +0200 @@ -372,18 +372,19 @@ } }; -var tableTr = function(cls,body){ - var tr = document.createElement('tr'); - YUD.addClass(tr, cls); - +var tableTr = function(cls, body){ + var _el = document.createElement('table'); var cont = new YAHOO.util.Element(body); var comment_id = fromHTML(body).children[0].id.split('comment-')[1]; - tr.id = 'comment-tr-{0}'.format(comment_id); - tr.innerHTML = '<td class="lineno-inline new-inline"></td>'+ - '<td class="lineno-inline old-inline"></td>'+ - '<td>{0}</td>'.format(body); - return tr; + var id = 'comment-tr-{0}'.format(comment_id); + var _html = ('tbody><tr id="{0}" class="{1}">'+ + '<td class="lineno-inline new-inline"></td>'+ + '<td class="lineno-inline old-inline"></td>'+ + '<td>{2}</td>'+ + '</tr>').format(id, cls, body); + _el.innerHTML = _html; + return _el.children[0].children[0]; }; /** comments **/ @@ -395,7 +396,7 @@ var tmpl = YUD.get('comment-inline-form-template').innerHTML; tmpl = tmpl.format(f_path, line); var form = tableTr('comment-form-inline',tmpl) - + // create event for hide button form = new YAHOO.util.Element(form); var form_hide_button = new YAHOO.util.Element(YUD.getElementsByClassName('hide-inline-form',null,form)[0]);