You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			25 lines
		
	
	
		
			760 B
		
	
	
	
		
			JavaScript
		
	
			
		
		
	
	
			25 lines
		
	
	
		
			760 B
		
	
	
	
		
			JavaScript
		
	
/*
 | 
						|
 * vim: ts=4:sw=4:expandtab
 | 
						|
 */
 | 
						|
(function () {
 | 
						|
    'use strict';
 | 
						|
    window.Whisper = window.Whisper || {};
 | 
						|
 | 
						|
    Whisper.ConversationListView = Whisper.ListView.extend({
 | 
						|
        tagName: 'div',
 | 
						|
        itemView: Whisper.ConversationListItemView,
 | 
						|
        sort: function(conversation) {
 | 
						|
            console.log('sorting conversation', conversation.id);
 | 
						|
            var $el = this.$('.' + conversation.cid);
 | 
						|
            if ($el && $el.length > 0) {
 | 
						|
                var index = getInboxCollection().indexOf(conversation);
 | 
						|
                if (index > 0) {
 | 
						|
                    $el.insertBefore(this.$('.conversation-list-item')[index+1]);
 | 
						|
                } else {
 | 
						|
                    this.$el.prepend($el);
 | 
						|
                }
 | 
						|
            }
 | 
						|
        }
 | 
						|
    });
 | 
						|
})();
 |