This commit is contained in:
psychobunny
2015-03-09 12:30:16 -04:00
parent 4360069859
commit e47c375e69
2 changed files with 13 additions and 6 deletions

View File

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

View File

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