mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 04:33:47 +08:00
Save composer height in localStorage
This commit is contained in:
parent
461885c40d
commit
3d6d3192d9
|
@ -38,7 +38,7 @@ export default Ember.View.extend(Ember.Evented, {
|
||||||
var controller = this.get('controller');
|
var controller = this.get('controller');
|
||||||
|
|
||||||
// Hide the composer to begin with.
|
// Hide the composer to begin with.
|
||||||
this.set('height', this.$().height());
|
this.set('height', localStorage.getItem('composerHeight') || this.$().height());
|
||||||
this.$().hide();
|
this.$().hide();
|
||||||
|
|
||||||
// If the composer is minimized, allow the user to click anywhere on
|
// 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
|
// height so that it fills the height of the composer, and update the
|
||||||
// body's padding.
|
// body's padding.
|
||||||
var deltaPixels = event.data.mouseStart - event.clientY;
|
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.updateContentHeight();
|
||||||
view.updateBodyPadding();
|
view.updateBodyPadding();
|
||||||
|
|
||||||
|
localStorage.setItem('composerHeight', height);
|
||||||
},
|
},
|
||||||
|
|
||||||
mouseWasReleased: function(event) {
|
mouseWasReleased: function(event) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user