mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
9912c2bfed
Closes #3520. Move the custom jQuery animation into an action on the controller so that we can trigger it from within the route if needed.
29 lines
1.0 KiB
JavaScript
29 lines
1.0 KiB
JavaScript
import {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;
|
|
// ### 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');
|
|
});
|
|
});
|
|
});
|
|
}.on('didInsertElement'),
|
|
});
|
|
|
|
export default PostsView;
|