Hummingbird.ChatView = Ember.View.extend({
  scrollToBottom: function() {
    var chatItems = this.$('.chat-items');
    if (chatItems) {
      Em.run.next(function() {
        chatItems.scrollTop(chatItems.prop('scrollHeight'));
      });
    }
  }.observes('controller.content.@each')
});

Hummingbird.ChatView = Ember.View.extend({
  scrollToBottom: function() {
    var chatItems = this.$('.chat-items');
    if (chatItems && (chatItems.prop('scrollTop') > (chatItems.prop('scrollHeight') - chatItems.innerHeight() * 1.5)) ) {
      Em.run.next(function() {
        chatItems.scrollTop(chatItems.prop('scrollHeight'));
      });
    }
  }.observes('controller.content.@each')
});

Improve chat autoscroll. When a new message arrives, don't scroll if user scrolled up his page more than 1/2 of his basic page height
Improve chat autoscroll. When a new message arrives, don't scroll if user scrolled up his page more than 1/2 of his basic page height
