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 | * SmartColorGenerator |
|
93 | * SmartColorGenerator | |
80 | * |
|
94 | * | |
@@ -483,7 +497,10 b' var injectInlineForm = function(tr){' | |||||
483 | tooltip_activate(); |
|
497 | tooltip_activate(); | |
484 | MentionsAutoComplete('text_'+lineno, 'mentions_container_'+lineno, |
|
498 | MentionsAutoComplete('text_'+lineno, 'mentions_container_'+lineno, | |
485 | _USERS_AC_DATA, _GROUPS_AC_DATA); |
|
499 | _USERS_AC_DATA, _GROUPS_AC_DATA); | |
486 |
YUD.get('text_'+lineno) |
|
500 | var _e = YUD.get('text_'+lineno); | |
|
501 | if(_e){ | |||
|
502 | _e.focus(); | |||
|
503 | } | |||
487 | },10) |
|
504 | },10) | |
488 | }; |
|
505 | }; | |
489 |
|
506 | |||
@@ -492,7 +509,7 b' var deleteComment = function(comment_id)' | |||||
492 | var postData = {'_method':'delete'}; |
|
509 | var postData = {'_method':'delete'}; | |
493 | var success = function(o){ |
|
510 | var success = function(o){ | |
494 | var n = YUD.get('comment-tr-'+comment_id); |
|
511 | var n = YUD.get('comment-tr-'+comment_id); | |
495 |
var root = n |
|
512 | var root = prevElementSibling(prevElementSibling(n)); | |
496 | n.parentNode.removeChild(n); |
|
513 | n.parentNode.removeChild(n); | |
497 |
|
514 | |||
498 | // scann nodes, and attach add button to last one |
|
515 | // scann nodes, and attach add button to last one | |
@@ -1234,23 +1251,24 b' var MentionsAutoComplete = function (div' | |||||
1234 | return [null, null]; |
|
1251 | return [null, null]; | |
1235 | }; |
|
1252 | }; | |
1236 |
|
1253 | |||
1237 | ownerAC.textboxKeyUpEvent.subscribe(function(type, args){ |
|
1254 | if (ownerAC.textboxKeyUpEvent){ | |
1238 |
|
1255 | ownerAC.textboxKeyUpEvent.subscribe(function(type, args){ | ||
1239 | var ac_obj = args[0]; |
|
1256 | ||
1240 |
var |
|
1257 | var ac_obj = args[0]; | |
1241 | var currentCaretPosition = args[0]._elTextbox.selectionStart; |
|
1258 | var currentMessage = args[1]; | |
1242 |
|
1259 | var currentCaretPosition = args[0]._elTextbox.selectionStart; | ||
1243 | var unam = ownerAC.get_mention(currentMessage, currentCaretPosition); |
|
1260 | ||
1244 | var curr_search = null; |
|
1261 | var unam = ownerAC.get_mention(currentMessage, currentCaretPosition); | |
1245 | if(unam[0]){ |
|
1262 | var curr_search = null; | |
1246 | curr_search = unam[0]; |
|
1263 | if(unam[0]){ | |
1247 | } |
|
1264 | curr_search = unam[0]; | |
1248 |
|
1265 | } | ||
1249 | ownerAC.dataSource.chunks = unam[1]; |
|
1266 | ||
1250 |
ownerAC.dataSource. |
|
1267 | ownerAC.dataSource.chunks = unam[1]; | |
1251 |
|
1268 | ownerAC.dataSource.mentionQuery = curr_search; | ||
1252 | }) |
|
1269 | ||
1253 |
|
1270 | }) | ||
|
1271 | } | |||
1254 | return { |
|
1272 | return { | |
1255 | ownerDS: ownerDS, |
|
1273 | ownerDS: ownerDS, | |
1256 | ownerAC: ownerAC, |
|
1274 | ownerAC: ownerAC, |
General Comments 0
You need to be logged in to leave comments.
Login now