mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	Move summary_adjective to its own method
(imported from commit d451ffcf3ff460ffe030e265ca83fec1094c6217)
This commit is contained in:
		@@ -282,6 +282,17 @@ MessageList.prototype = {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    summary_adjective: function (message) {
 | 
				
			||||||
 | 
					        if (_.contains(message.flags, 'force_collapse')) {
 | 
				
			||||||
 | 
					            return 'collapsed';
 | 
				
			||||||
 | 
					        } else if (!_.contains(message.flags, 'force_expand')) {
 | 
				
			||||||
 | 
					            if (this.is_summarized_message(message)) {
 | 
				
			||||||
 | 
					                return 'read';
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        return null;
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    selected_idx: function MessageList_selected_idx() {
 | 
					    selected_idx: function MessageList_selected_idx() {
 | 
				
			||||||
        return util.lower_bound(this._items, this._selected_id,
 | 
					        return util.lower_bound(this._items, this._selected_id,
 | 
				
			||||||
                                function (a, b) { return a.id < b; });
 | 
					                                function (a, b) { return a.id < b; });
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -164,15 +164,7 @@ MessageListView.prototype = {
 | 
				
			|||||||
                finish_summary();
 | 
					                finish_summary();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var summary_adjective;
 | 
					            var summary_adjective = list.summary_adjective(message);
 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (_.contains(message.flags, 'force_collapse')) {
 | 
					 | 
				
			||||||
                summary_adjective = 'collapsed';
 | 
					 | 
				
			||||||
            } else if (!_.contains(message.flags, 'force_expand')) {
 | 
					 | 
				
			||||||
                if (list.is_summarized_message(message)) {
 | 
					 | 
				
			||||||
                    summary_adjective = 'read';
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (summary_adjective) {
 | 
					            if (summary_adjective) {
 | 
				
			||||||
                if (prev) {
 | 
					                if (prev) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user