1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 13:40:20 +02:00

Work on composer, early implementation of replying

This commit is contained in:
Toby Zerner
2015-01-30 12:22:19 +10:30
parent edce73d6e9
commit 12622e6c28
11 changed files with 229 additions and 72 deletions

View File

@@ -89,20 +89,14 @@ export default Ember.View.extend(Ember.Evented, {
populateControlsDefault: function(controls) {
var view = this;
var ReplyItem = ActionButton.extend({
var reply = ActionButton.create({
label: 'Reply',
icon: 'reply',
classNameBindings: ['className', 'replying:disabled'],
replying: function() {
return this.get('parentController.controllers.composer.showing');
}.property('parentController.controllers.composer.showing'),
action: function() {
var lastPost = $('.posts .item:last');
$('html, body').animate({scrollTop: lastPost.offset().top + lastPost.outerHeight() - $(window).height() + $('.composer').height() + 19}, 'fast');
view.get('streamContent').send('goToIndex', view.get('controller.stream.count') - 1);
view.get('controller').send('reply');
},
parentController: this.get('controller'),
});
controls.pushObjectWithTag(ReplyItem.create(), 'reply');
controls.pushObjectWithTag(reply, 'reply');
}.on('populateControls')
});