From e4692e35544ad5dae77594493c8a45fd5d9ecc68 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 6 Feb 2015 12:21:34 +1030 Subject: [PATCH] Save composer height in localStorage --- ember/app/views/composer.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ember/app/views/composer.js b/ember/app/views/composer.js index 238fd65c4..64fcd3d6b 100644 --- a/ember/app/views/composer.js +++ b/ember/app/views/composer.js @@ -38,7 +38,7 @@ export default Ember.View.extend(Ember.Evented, { var controller = this.get('controller'); // Hide the composer to begin with. - this.set('height', this.$().height()); + this.set('height', localStorage.getItem('composerHeight') || this.$().height()); this.$().hide(); // If the composer is minimized, allow the user to click anywhere on @@ -223,9 +223,12 @@ export default Ember.View.extend(Ember.Evented, { // height so that it fills the height of the composer, and update the // body's padding. var deltaPixels = event.data.mouseStart - event.clientY; - view.set('height', event.data.heightStart + deltaPixels); + var height = event.data.heightStart + deltaPixels; + view.set('height', height); view.updateContentHeight(); view.updateBodyPadding(); + + localStorage.setItem('composerHeight', height); }, mouseWasReleased: function(event) {