UX: Change heuristic for determining slide vs drop down

This commit is contained in:
Robin Ward 2015-08-29 11:18:26 -04:00
parent 4dc5717af4
commit aa45429989
1 changed files with 7 additions and 1 deletions

View File

@ -49,7 +49,11 @@ export default Ember.Component.extend({
const force = this.get('force'); const force = this.get('force');
if (force) { return force; } if (force) { return force; }
return ($(window).width() < 1024) ? 'slide-in' : 'drop-down'; const headerWidth = $('#main-outlet .container').width() || 1100;
const screenWidth = $(window).width();
const remaining = parseInt((screenWidth - headerWidth) / 2);
return (remaining < 50) ? 'slide-in' : 'drop-down';
}, },
@observes('viewMode', 'visible') @observes('viewMode', 'visible')
@ -147,6 +151,8 @@ export default Ember.Component.extend({
Ember.run(() => this.performLayout()); Ember.run(() => this.performLayout());
}); });
} }
this.propertyDidChange('viewMode');
}, },
@on('willDestroyElement') @on('willDestroyElement')