2014-07-13 21:03:48 +04:00
|
|
|
import {responsiveAction} from 'ghost/utils/mobile';
|
2014-06-24 10:19:20 +04:00
|
|
|
|
|
|
|
var PostsView = Ember.View.extend({
|
2014-08-01 10:47:29 +04:00
|
|
|
target: Ember.computed.alias('controller'),
|
2014-06-24 10:19:20 +04:00
|
|
|
classNames: ['content-view-container'],
|
|
|
|
tagName: 'section',
|
|
|
|
|
|
|
|
mobileInteractions: function () {
|
|
|
|
Ember.run.scheduleOnce('afterRender', this, function () {
|
2014-08-01 10:47:29 +04:00
|
|
|
var self = this;
|
2014-06-24 10:19:20 +04:00
|
|
|
// ### Show content preview when swiping left on content list
|
|
|
|
$('.manage').on('click', '.content-list ol li', function (event) {
|
|
|
|
responsiveAction(event, '(max-width: 800px)', function () {
|
2014-08-01 10:47:29 +04:00
|
|
|
self.send('showContentPreview');
|
2014-06-24 10:19:20 +04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// ### Hide content preview
|
|
|
|
$('.manage').on('click', '.content-preview .button-back', function (event) {
|
|
|
|
responsiveAction(event, '(max-width: 800px)', function () {
|
2014-08-01 10:47:29 +04:00
|
|
|
self.send('hideContentPreview');
|
2014-06-24 10:19:20 +04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}.on('didInsertElement'),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default PostsView;
|