aboutsummaryrefslogtreecommitdiff
path: root/haddock-api
diff options
context:
space:
mode:
authorPhil Ruffwind <rf@rufflewind.com>2015-06-14 23:12:09 -0400
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2015-08-02 23:15:26 +0100
commit7656bf86a661c5c755dc9874f709df2fc4833257 (patch)
treeaa4fa76419986186657d0cb52371775ba0854fee /haddock-api
parent089d20c23c5e3a00856ee9480a3953060b03ed7b (diff)
Avoid JavaScript error during page load in non-frame mode
In non-frame mode, parent.window.synopsis refers to the synopsis div rather than the nonexistent frame. Unfortunately, the script wrongly assumes that if it exists it must be a frame, leading to an error where it tries to access the nonexistent attribute 'replace' of an undefined value (synopsis.location). Closes #406
Diffstat (limited to 'haddock-api')
-rw-r--r--haddock-api/resources/html/haddock-util.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/haddock-api/resources/html/haddock-util.js b/haddock-api/resources/html/haddock-util.js
index ba574356..fc7743fe 100644
--- a/haddock-api/resources/html/haddock-util.js
+++ b/haddock-api/resources/html/haddock-util.js
@@ -229,7 +229,7 @@ function perform_search(full)
}
function setSynopsis(filename) {
- if (parent.window.synopsis) {
+ if (parent.window.synopsis && parent.window.synopsis.location) {
if (parent.window.synopsis.location.replace) {
// In Firefox this avoids adding the change to the history.
parent.window.synopsis.location.replace(filename);