v1.18.x
psychobunny 10 years ago
parent 4360069859
commit e47c375e69

@ -10,13 +10,15 @@ $(document).ready(function() {
rootUrl = location.protocol + '//' + (location.hostname || location.host) + (location.port ? ':' + location.port : ''), rootUrl = location.protocol + '//' + (location.hostname || location.host) + (location.port ? ':' + location.port : ''),
apiXHR = null; apiXHR = null;
window.onpopstate = function (event) { $(window).on('popstate', function (ev) {
if (event !== null && event.state && event.state.url !== undefined) { ev = ev.originalEvent;
ajaxify.go(event.state.url, function() {
$(window).trigger('action:popstate', {url: event.state.url}); if (ev !== null && ev.state && ev.state.url !== undefined) {
ajaxify.go(ev.state.url, function() {
$(window).trigger('action:popstate', {url: ev.state.url});
}, true); }, true);
} }
}; });
ajaxify.currentPage = null; ajaxify.currentPage = null;

@ -22,7 +22,7 @@ define('composer', [
$(window).off('resize', onWindowResize).on('resize', onWindowResize); $(window).off('resize', onWindowResize).on('resize', onWindowResize);
$(window).on('action:popstate', function(ev, data) { $(window).on('popstate', function(ev, data) {
var env = utils.findBootstrapEnvironment(); var env = utils.findBootstrapEnvironment();
if (composer.active && (env === 'xs' || env ==='sm')) { if (composer.active && (env === 'xs' || env ==='sm')) {
@ -95,6 +95,11 @@ define('composer', [
composer.posts[uuid] = post; composer.posts[uuid] = post;
composer.load(uuid); composer.load(uuid);
var env = utils.findBootstrapEnvironment();
if (env === 'xs' || env ==='sm') {
history.pushState({}, '', '#compose');
}
} }
function composerAlert(message) { function composerAlert(message) {

Loading…
Cancel
Save