##// END OF EJS Templates
ie8 fixes for inline comments :/
marcink -
r2698:4debfe3b beta
parent child Browse files
Show More
@@ -75,6 +75,20 b' if(!Array.prototype.indexOf) {'
75 75 };
76 76 }
77 77
78 // IE(CRAP) doesn't support previousElementSibling
79 var prevElementSibling = function( el ) {
80 if( el.previousElementSibling ) {
81 return el.previousElementSibling;
82 } else {
83 while( el = el.previousSibling ) {
84 if( el.nodeType === 1 ) return el;
85 }
86 }
87 }
88
89
90
91
78 92 /**
79 93 * SmartColorGenerator
80 94 *
@@ -483,7 +497,10 b' var injectInlineForm = function(tr){'
483 497 tooltip_activate();
484 498 MentionsAutoComplete('text_'+lineno, 'mentions_container_'+lineno,
485 499 _USERS_AC_DATA, _GROUPS_AC_DATA);
486 YUD.get('text_'+lineno).focus();
500 var _e = YUD.get('text_'+lineno);
501 if(_e){
502 _e.focus();
503 }
487 504 },10)
488 505 };
489 506
@@ -492,7 +509,7 b' var deleteComment = function(comment_id)'
492 509 var postData = {'_method':'delete'};
493 510 var success = function(o){
494 511 var n = YUD.get('comment-tr-'+comment_id);
495 var root = n.previousElementSibling.previousElementSibling;
512 var root = prevElementSibling(prevElementSibling(n));
496 513 n.parentNode.removeChild(n);
497 514
498 515 // scann nodes, and attach add button to last one
@@ -1234,23 +1251,24 b' var MentionsAutoComplete = function (div'
1234 1251 return [null, null];
1235 1252 };
1236 1253
1237 ownerAC.textboxKeyUpEvent.subscribe(function(type, args){
1238
1239 var ac_obj = args[0];
1240 var currentMessage = args[1];
1241 var currentCaretPosition = args[0]._elTextbox.selectionStart;
1242
1243 var unam = ownerAC.get_mention(currentMessage, currentCaretPosition);
1244 var curr_search = null;
1245 if(unam[0]){
1246 curr_search = unam[0];
1247 }
1248
1249 ownerAC.dataSource.chunks = unam[1];
1250 ownerAC.dataSource.mentionQuery = curr_search;
1251
1252 })
1253
1254 if (ownerAC.textboxKeyUpEvent){
1255 ownerAC.textboxKeyUpEvent.subscribe(function(type, args){
1256
1257 var ac_obj = args[0];
1258 var currentMessage = args[1];
1259 var currentCaretPosition = args[0]._elTextbox.selectionStart;
1260
1261 var unam = ownerAC.get_mention(currentMessage, currentCaretPosition);
1262 var curr_search = null;
1263 if(unam[0]){
1264 curr_search = unam[0];
1265 }
1266
1267 ownerAC.dataSource.chunks = unam[1];
1268 ownerAC.dataSource.mentionQuery = curr_search;
1269
1270 })
1271 }
1254 1272 return {
1255 1273 ownerDS: ownerDS,
1256 1274 ownerAC: ownerAC,
General Comments 0
You need to be logged in to leave comments. Login now