mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 06:12:03 +03:00
e48b5edbb4
Closes #4032 - Created "mobile" views: `parent-view`, `content-view` and `index-view` - `mobile/parent-view` has three callbacks for managing layout, and a mediaQuery listener to keep in sync with the user - content-view and index-view use their parent-views callbacks to bring themselves into and out of the viewport as appropriate - fixed media queries for post content list from 800px to 900px - Created `mobile-index-route` to intelligently transition to a new route on desktops (used by both PostsIndexRoute and SettingsIndexRoute) - Extract mobile interactions from settings views to new mobile utility views - `js-` prefixed settings view transitions - removed unused openEditor action from PostsRoute - removed unused mobile util "responsiveAction"
23 lines
837 B
JavaScript
23 lines
837 B
JavaScript
import MobileParentView from 'ghost/views/mobile/parent-view';
|
|
|
|
var PostsView = MobileParentView.extend({
|
|
classNames: ['content-view-container'],
|
|
tagName: 'section',
|
|
|
|
// Mobile parent view callbacks
|
|
showMenu: function () {
|
|
$('.js-content-list').animate({right: '0', left: '0', 'margin-right': '0'}, 300);
|
|
$('.js-content-preview').animate({right: '-100%', left: '100%', 'margin-left': '15px'}, 300);
|
|
},
|
|
showContent: function () {
|
|
$('.js-content-list').animate({right: '100%', left: '-100%', 'margin-right': '15px'}, 300);
|
|
$('.js-content-preview').animate({right: '0', left: '0', 'margin-left': '0'}, 300);
|
|
},
|
|
showAll: function () {
|
|
$('.js-content-list').removeAttr('style');
|
|
$('.js-content-preview').removeAttr('style');
|
|
}
|
|
});
|
|
|
|
export default PostsView;
|