Changeset - e975e1d41059
[Not reviewed]
Bradley M. Kuhn - 12 years ago 2014-07-03 01:03:29
bkuhn@sfconservancy.org
rhodecode.js: workaround missing unknown autocomplete textboxKeyUpEvent

It was introduced in the YUI update in 5143b8df576c and used for @mention handling.
1 file changed with 5 insertions and 14 deletions:
0 comments (0 inline, 0 general)
rhodecode/public/js/rhodecode.js
Show inline comments
 
@@ -1370,13 +1370,12 @@ var MentionsAutoComplete = function (div
 
                return '';
 
            }
 
        };
 

	
 
    if(ownerAC.itemSelectEvent){
 
        ownerAC.itemSelectEvent.subscribe(function (sType, aArgs) {
 

	
 
            var myAC = aArgs[0]; // reference back to the AC instance
 
            var elLI = aArgs[1]; // reference to the selected LI element
 
            var oData = aArgs[2]; // object literal of selected item's result data
 
            //fill the autocomplete with value
 
            if (oData.nname != undefined) {
 
                //users
 
@@ -1424,34 +1423,26 @@ var MentionsAutoComplete = function (div
 
            var unam = re.exec(msg2)[1];
 
            return [unam, chunks];
 
        }
 
        return [null, null];
 
    };
 

	
 
    if (ownerAC.textboxKeyUpEvent){
 
        ownerAC.textboxKeyUpEvent.subscribe(function(type, args){
 

	
 
            var ac_obj = args[0];
 
            var currentMessage = args[1];
 
            var currentCaretPosition = args[0]._elTextbox.selectionStart;
 
    $divid = $('#'+divid);
 
    $divid.keyup(function(e){
 
            var currentMessage = $divid.val();
 
            var currentCaretPosition = $divid[0].selectionStart;
 

	
 
            var unam = ownerAC.get_mention(currentMessage, currentCaretPosition);
 
            var curr_search = null;
 
            if(unam[0]){
 
                curr_search = unam[0];
 
            }
 

	
 
            ownerAC.dataSource.chunks = unam[1];
 
            ownerAC.dataSource.mentionQuery = curr_search;
 

	
 
        })
 
    }
 
    return {
 
        ownerDS: ownerDS,
 
        ownerAC: ownerAC,
 
    };
 
        });
 
}
 

	
 
var addReviewMember = function(id,fname,lname,nname,gravatar_link){
 
    var displayname = "{0} {1} ({2})".format(fname, lname, nname);
 
    var element = (
 
        '     <li id="reviewer_{2}">\n'+
0 comments (0 inline, 0 general)