Sha256: 9e790520ff43c7e11e908df4c7ed68fe049161f7b73f36f0d9320a5a0a6e1b7c
Contents?: true
Size: 781 Bytes
Versions: 67
Compression:
Stored size: 781 Bytes
Contents
pageflow.History.PushStateAdapter = function() { var counter = 0; this.back = function() { if (counter > 0) { window.history.back(); return true; } return false; }; this.pushState = function(state, title, hash) { counter += 1; window.history.pushState(state, title, '#' + hash); }; this.replaceState = function(state, title, hash) { window.history.replaceState(state, title, '#' + hash); }; this.state = function() { return history.state; }; this.hash = function() { var match = window.location.href.match(/#(.*)$/); return match ? match[1] : ''; }; this.on = function(event, listener) { return $(window).on(event, listener); }; $(window).on('popstate', function() { counter -= 1; }); };
Version data entries
67 entries across 67 versions & 1 rubygems