FIX: modify select-box orientation when composer resizes

This commit is contained in:
Joffrey JAFFEUX 2017-08-24 17:14:55 +02:00 committed by GitHub
parent 21d6c7f6b3
commit 9c446fcb4d
2 changed files with 12 additions and 2 deletions

View File

@ -61,6 +61,16 @@ export default SelectBoxComponent.extend({
this.set("content", filteredCategories);
},
@on("didRender")
_bindComposerResizing() {
this.appEvents.on("composer:resized", this, this.applyDirection);
},
@on("willDestroyElement")
_unbindComposerResizing() {
this.appEvents.off("composer:resized");
},
@on("init")
@observes("site.sortedCategories")
_updateCategories() {

View File

@ -136,7 +136,7 @@ export default Ember.Component.extend({
this._bindTab();
Ember.run.schedule('afterRender', () => {
this._applyDirection();
this.applyDirection();
this._positionSelectBoxWrapper();
});
} else {
@ -272,7 +272,7 @@ export default Ember.Component.extend({
});
},
_applyDirection() {
applyDirection() {
this.$().removeClass("is-reversed");
const offsetTop = this.$()[0].getBoundingClientRect().top;