##// END OF EJS Templates
fixed comment addition and deletion functionality on IE9
Dies Koper -
r2723:04aa0ea1 beta
parent child Browse files
Show More
@@ -398,7 +398,7 b' var createInlineForm = function(parent_t'
398 398
399 399 // create event for hide button
400 400 form = new YAHOO.util.Element(form);
401 var form_hide_button = new YAHOO.util.Element(form.getElementsByClassName('hide-inline-form')[0]);
401 var form_hide_button = new YAHOO.util.Element(YUD.getElementsByClassName('hide-inline-form',null,form)[0]);
402 402 form_hide_button.on('click', function(e) {
403 403 var newtr = e.currentTarget.parentNode.parentNode.parentNode.parentNode.parentNode;
404 404 if(YUD.hasClass(newtr.nextElementSibling,'inline-comments-button')){
@@ -422,12 +422,12 b' var injectInlineForm = function(tr){'
422 422 return
423 423 }
424 424 var submit_url = AJAX_COMMENT_URL;
425 var _td = tr.getElementsByClassName('code')[0];
425 var _td = YUD.getElementsByClassName('code',null,tr)[0];
426 426 if(YUD.hasClass(tr,'form-open') || YUD.hasClass(tr,'context') || YUD.hasClass(_td,'no-comment')){
427 427 return
428 428 }
429 429 YUD.addClass(tr,'form-open');
430 var node = tr.parentNode.parentNode.parentNode.getElementsByClassName('full_f_path')[0];
430 var node = YUD.getElementsByClassName('full_f_path',null,tr.parentNode.parentNode.parentNode)[0];
431 431 var f_path = YUD.getAttribute(node,'path');
432 432 var lineno = getLineNo(tr);
433 433 var form = createInlineForm(tr, f_path, lineno, submit_url);
@@ -447,8 +447,8 b' var injectInlineForm = function(tr){'
447 447
448 448 var f = YUD.get(form);
449 449
450 var overlay = f.getElementsByClassName('overlay')[0];
451 var _form = f.getElementsByClassName('inline-form')[0];
450 var overlay = YUD.getElementsByClassName('overlay',null,f)[0];
451 var _form = YUD.getElementsByClassName('inline-form',null,f)[0];
452 452
453 453 form.on('submit',function(e){
454 454 YUE.preventDefault(e);
@@ -568,8 +568,8 b' var placeAddButton = function(target_tr)'
568 568 // next element are comments !
569 569 if(YUD.hasClass(n,'inline-comments')){
570 570 last_node = n;
571 //also remove the comment button from previos
572 var comment_add_buttons = last_node.getElementsByClassName('add-comment');
571 //also remove the comment button from previous
572 var comment_add_buttons = YUD.getElementsByClassName('add-comment',null,last_node);
573 573 for(var i=0;i<comment_add_buttons.length;i++){
574 574 var b = comment_add_buttons[i];
575 575 b.parentNode.removeChild(b);
@@ -582,7 +582,7 b' var placeAddButton = function(target_tr)'
582 582
583 583 var add = createInlineAddButton(target_tr);
584 584 // get the comment div
585 var comment_block = last_node.getElementsByClassName('comment')[0];
585 var comment_block = YUD.getElementsByClassName('comment',null,last_node)[0];
586 586 // attach add button
587 587 YUD.insertAfter(add,comment_block);
588 588 }
@@ -889,7 +889,7 b' var readNotification = function(url, not'
889 889 success:function(o){
890 890 var obj = YUD.get(String("notification_"+notification_id));
891 891 YUD.removeClass(obj, 'unread');
892 var r_button = obj.children[0].getElementsByClassName('read-notification')[0]
892 var r_button = YUD.getElementsByClassName('read-notification',null,obj.children[0])[0];
893 893
894 894 if(r_button.parentNode !== undefined){
895 895 r_button.parentNode.removeChild(r_button);
@@ -1737,4 +1737,4 b' var MultiSelectWidget = function(selecte'
1737 1737 }
1738 1738 });
1739 1739 }
1740 } No newline at end of file
1740 }
@@ -149,6 +149,9 b''
149 149 YUE.on(YUQ('.show-inline-comments'),'change',function(e){
150 150 var show = 'none';
151 151 var target = e.currentTarget;
152 if(target == null){
153 target = this;
154 }
152 155 if(target.checked){
153 156 var show = ''
154 157 }
@@ -165,6 +168,9 b''
165 168
166 169 YUE.on(YUQ('.line'),'click',function(e){
167 170 var tr = e.currentTarget;
171 if(tr == null){
172 tr = this;
173 }
168 174 injectInlineForm(tr);
169 175 });
170 176
General Comments 0
You need to be logged in to leave comments. Login now