Skip to content

Commit

Permalink
fix(pjax): Fix back/foward #1
Browse files Browse the repository at this point in the history
  • Loading branch information
oswaldoacauan committed Nov 19, 2013
1 parent 8fdabd7 commit 0212b43
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/assets/js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
if(Drawer.isOpen())
Drawer.close();
});

$document.on('pjax:end', function() {
if(ga !== undefined) {
ga('set', 'location', window.location.href);
Expand All @@ -55,16 +56,11 @@
NProgress.done();
});

var pjaxHandler = function(e) {
$.pjax.click(e, {
container: '[data-pjax-container]',
fragment: '[data-pjax-container]',
replace: true
});
};
$document.pjax('a[data-pjax]', '[data-pjax-container]');

$document.on('click', 'a[data-pjax]', pjaxHandler);
$document.on('submit', 'form[data-pjax]', pjaxHandler);
$document.on('submit', 'form[data-pjax]', function(e) {
$.pjax.submit(e, '[data-pjax-container]')
})
}

// Data API bindings
Expand Down

5 comments on commit 0212b43

@jeffpoulton
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled down the fix, but am not having any luck. Aside from restarting node, is anything else required on my end to see the fix?

@oswaldoacauan
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to 'rebuild' Ghostium. Take a look on the build task on Gruntfile.js

@jeffpoulton
Copy link

@jeffpoulton jeffpoulton commented on 0212b43 Nov 21, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yosz
Copy link
Contributor

@yosz yosz commented on 0212b43 Nov 21, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zip contains last release which don't include latest bug fixes.

I also had problems with imagemin - it couldn't find libjpeg. As it turns out grunt-contrib-imagemin has some problems installing on windows (gruntjs/grunt-contrib-imagemin#109). It helped to install specific version of grun-contrib-imagemin npm install [email protected]

@oswaldoacauan
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run npm install again.

The grunt-contrib-imagemin like @yosz said has some problems windows, soo just use grunt build --force.

Please sign in to comment.