mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 19:52:01 +03:00
d236d0a7c3
closes #3018 - split clientold mobile interactions into their respective Ember routes/views - create PostsView and SettingsView with mobile interactions - place interactions for the publish bar into ApplicationRoute on init
31 lines
1.3 KiB
JavaScript
31 lines
1.3 KiB
JavaScript
import mobileUtils from 'ghost/utils/mobile-utils';
|
|
|
|
var PostsView = Ember.View.extend({
|
|
classNames: ['content-view-container'],
|
|
tagName: 'section',
|
|
|
|
mobileInteractions: function () {
|
|
var responsiveAction = mobileUtils.responsiveAction;
|
|
|
|
Ember.run.scheduleOnce('afterRender', this, function () {
|
|
// ### Show content preview when swiping left on content list
|
|
$('.manage').on('click', '.content-list ol li', function (event) {
|
|
responsiveAction(event, '(max-width: 800px)', function () {
|
|
$('.content-list').animate({right: '100%', left: '-100%', 'margin-right': '15px'}, 300);
|
|
$('.content-preview').animate({right: '0', left: '0', 'margin-left': '0'}, 300);
|
|
});
|
|
});
|
|
|
|
// ### Hide content preview
|
|
$('.manage').on('click', '.content-preview .button-back', function (event) {
|
|
responsiveAction(event, '(max-width: 800px)', function () {
|
|
$('.content-list').animate({right: '0', left: '0', 'margin-right': '0'}, 300);
|
|
$('.content-preview').animate({right: '-100%', left: '100%', 'margin-left': '15px'}, 300);
|
|
});
|
|
});
|
|
});
|
|
}.on('didInsertElement'),
|
|
});
|
|
|
|
export default PostsView;
|