mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
2f1a55fa66
closes #3623 - Initialization of the link was done on login page where the ‚burger‘ did not exist. - initialization in application needs to be done to make it work on refresh
37 lines
1.3 KiB
JavaScript
37 lines
1.3 KiB
JavaScript
import {mobileQuery, responsiveAction} from 'ghost/utils/mobile';
|
|
|
|
var PostsView = Ember.View.extend({
|
|
target: Ember.computed.alias('controller'),
|
|
classNames: ['content-view-container'],
|
|
tagName: 'section',
|
|
|
|
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 () {
|
|
self.send('showContentPreview');
|
|
});
|
|
});
|
|
|
|
// ### Hide content preview
|
|
$('.manage').on('click', '.content-preview .button-back', function (event) {
|
|
responsiveAction(event, '(max-width: 800px)', function () {
|
|
self.send('hideContentPreview');
|
|
});
|
|
});
|
|
$('[data-off-canvas]').attr('href', this.get('controller.ghostPaths.blogRoot'));
|
|
});
|
|
}.on('didInsertElement'),
|
|
});
|
|
|
|
export default PostsView;
|