2014-08-06 07:26:22 +04:00
|
|
|
import {mobileQuery, 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-09-03 07:42:03 +04:00
|
|
|
//@TODO Kill all the jqueries.
|
2014-08-06 07:26:22 +04:00
|
|
|
$(window).resize(function () {
|
|
|
|
if (!mobileQuery.matches) {
|
|
|
|
self.send('resetContentPreview');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
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) {
|
2014-09-03 07:42:03 +04:00
|
|
|
responsiveAction(event, '(max-width: 900px)', function () {
|
2014-08-01 10:47:29 +04:00
|
|
|
self.send('showContentPreview');
|
2014-06-24 10:19:20 +04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// ### Hide content preview
|
2014-09-03 07:42:03 +04:00
|
|
|
$('.manage').on('click', '.content-preview .btn.btn-back', function (event) {
|
|
|
|
responsiveAction(event, '(max-width: 900px)', 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;
|