Ghost/ghost/admin/views/posts.js
Matt Enlow c1cae072f2 js- prefix; fix content preview back button
Closes #1990, Ref #3810
- Add `js-` prefix to jQuery calls throughout code and templates
- move MarkdownComponent classNames to template
- Fix back button on posts content preview
- Remove dead code for preview tabbing jQuery
2014-09-02 22:29:32 -06:00

36 lines
1.2 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;
//@TODO Kill all the jqueries.
$(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: 900px)', function () {
self.send('showContentPreview');
});
});
// ### Hide content preview
$('.manage').on('click', '.content-preview .btn.btn-back', function (event) {
responsiveAction(event, '(max-width: 900px)', function () {
self.send('hideContentPreview');
});
});
});
}.on('didInsertElement'),
});
export default PostsView;