-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support $('#main').data('smoothState').reload() #363
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -505,7 +505,30 @@ | |
window.location = url; | ||
} | ||
}, | ||
/**Reload the page */ | ||
reload = function () { | ||
// Apply rate limiting. | ||
if (!isRateLimited()) { | ||
|
||
// Set the delay timeout until the next event is allowed. | ||
setRateLimitRepeatTime(); | ||
|
||
// clear cache | ||
cache = {}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if someone's cache has 4 or 5 entries, will this wipe the entire thing? Possible to search for the current location and remove only the one entry? |
||
$container.data('smoothState').cache = cache; | ||
|
||
var request = utility.translate(window.location.href); | ||
isTransitioning = true; | ||
targetHash = window.location.hash; | ||
|
||
// Allows modifications to the request | ||
request = options.alterRequest(request); | ||
console.log(request); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this |
||
options.onBefore(null, $container); | ||
|
||
load(request); | ||
} | ||
}, | ||
/** | ||
* Loads the contents of a url into our container | ||
* @param {string} url | ||
|
@@ -799,6 +822,7 @@ | |
href: currentHref, | ||
cache: cache, | ||
clear: clear, | ||
reload: reload, | ||
load: load, | ||
fetch: fetch, | ||
restartCSSAnimations: restartCSSAnimations | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably needs a docblock like all the others, just to keep to coding standards.