Skip to content

Commit

Permalink
Provide context path to comet session reload function
Browse files Browse the repository at this point in the history
  • Loading branch information
farmdawgnation committed Aug 25, 2017
1 parent fe37149 commit fa78d52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions web/webkit/src/main/resources/toserve/lift.js
Expand Up @@ -76,8 +76,12 @@
},
cometGetTimeout: 140000,
cometFailureRetryTimeout: 10000,
cometOnSessionLost: function() {
window.location.href = "/";
cometOnSessionLost: function(contextPath) {
if (contextPath === null || contextPath === undefined) {
window.location.href = "/";
} else {
window.location.href = contextPath;
}
},
cometServer: null,
cometOnError: function(e) {
Expand Down Expand Up @@ -711,7 +715,7 @@
if (typeof elementOrId === 'string') {
element = document.getElementById(elementOrId);
}

// This is a Lift addition to allow return false to properly do
// cross-browser preventDefault/stopPropagation/etc work.
function normalizeEventReturn(event) {
Expand All @@ -722,7 +726,7 @@
event.stopPropagation();
}
}

return result;
}

Expand Down
2 changes: 1 addition & 1 deletion web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala
Expand Up @@ -775,7 +775,7 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable {
* lift.cometOnSessionLost reloads the current page by default.
*/
val noCometSessionCmd = new FactoryMaker[JsCmd](
() => JsCmds.Run("lift.cometOnSessionLost()")
() => JsCmds.Run(s"lift.cometOnSessionLost('${S.contextPath}')")
) {}

/**
Expand Down

0 comments on commit fa78d52

Please sign in to comment.