UX: Change heuristic for determining slide vs drop down
This commit is contained in:
parent
4dc5717af4
commit
aa45429989
|
@ -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')
|
||||||
|
|
Loading…
Reference in New Issue