0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Merge pull request #4012 from PaulAdamDavis/no-mob-setting-transitions

Snap page transition for mobile settings
This commit is contained in:
John O'Nolan 2014-09-11 15:43:54 +02:00
commit 1217529519
2 changed files with 11 additions and 5 deletions

View file

@ -141,6 +141,12 @@
// The main content panel on the right
.settings-content {
margin-left: 25%;
@media (max-width: 800px) {
&.fade-in {
animation: none;
}
}
.settings-general img {
max-width: 100%;

View file

@ -4,8 +4,8 @@ var SettingsView = Ember.View.extend({
// used by SettingsContentBaseView and on resize to mobile from desktop
showSettingsContent: function () {
if (mobileQuery.matches) {
$('.settings-menu').animate({right: '100%', left: '-110%', 'margin-right': '15px'}, 300);
$('.settings-content').animate({right: '0', left: '0', 'margin-left': '0'}, 300);
$('.settings-menu').css({right: '100%', left: '-110%', 'margin-right': '15px'});
$('.settings-content').css({right: '0', left: '0', 'margin-left': '0'});
$('.settings-header-inner').css('display', 'block');
}
},
@ -13,12 +13,12 @@ var SettingsView = Ember.View.extend({
showSettingsMenu: function () {
if (mobileQuery.matches) {
$('.settings-header-inner').css('display', 'none');
$('.settings-menu').animate({right: '0', left: '0', 'margin-right': '0'}, 300);
$('.settings-content').animate({right: '-100%', left: '100%', 'margin-left': '15'}, 300);
$('.settings-menu').css({right: '0', left: '0', 'margin-right': '0'});
$('.settings-content').css({right: '-100%', left: '100%', 'margin-left': '15'});
}
},
showAll: function () {
//Remove any styles applied by jQuery#animate
//Remove any styles applied by jQuery#css
$('.settings-menu, .settings-content').removeAttr('style');
},