0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Restore original display after window resizing.

fixes #3597
This commit is contained in:
Robert Jackson 2014-08-05 23:26:22 -04:00 committed by Hannah Wolfe
parent 5880c7088a
commit 8d2b26daea
2 changed files with 13 additions and 1 deletions

View file

@ -75,6 +75,11 @@ var PostsController = Ember.ArrayController.extend(PaginationControllerMixin, {
},
actions: {
resetContentPreview: function () {
$('.content-list').removeAttr('style');
$('.content-preview').removeAttr('style');
},
showContentPreview: function () {
$('.content-list').animate({right: '100%', left: '-100%', 'margin-right': '15px'}, 300);
$('.content-preview').animate({right: '0', left: '0', 'margin-left': '0'}, 300);

View file

@ -1,4 +1,4 @@
import {responsiveAction} from 'ghost/utils/mobile';
import {mobileQuery, responsiveAction} from 'ghost/utils/mobile';
var PostsView = Ember.View.extend({
target: Ember.computed.alias('controller'),
@ -8,6 +8,13 @@ var PostsView = Ember.View.extend({
mobileInteractions: function () {
Ember.run.scheduleOnce('afterRender', this, function () {
var self = this;
$(window).resize(function () {
if (!mobileQuery.matches) {
self.send('resetContentPreview');
}
});
// ### Show content preview when swiping left on content list
$('.manage').on('click', '.content-list ol li', function (event) {
responsiveAction(event, '(max-width: 800px)', function () {