Skip to content

Commit

Permalink
Merge pull request #1903 from lift/msf_issue_1901
Browse files Browse the repository at this point in the history
Provide context path to comet session reload function
  • Loading branch information
farmdawgnation authored Sep 13, 2017
2 parents d5d34cb + d506eb4 commit dfab883
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
7 changes: 7 additions & 0 deletions contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,15 @@ Riccardo Sirigu
### Email: ###
me at riccardosirigu dot com

### Name: ###
Josef Vlach

### Email: ###
vlach.josef at gmail dot com

### Name: ###
Noel Kennedy

### Email: ###
nkennedy at rvc dot ac dot uk

12 changes: 6 additions & 6 deletions web/webkit/src/main/resources/toserve/lift.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
},
cometGetTimeout: 140000,
cometFailureRetryTimeout: 10000,
cometOnSessionLost: function() {
window.location.href = "/";
cometOnSessionLost: function(contextPath) {
window.location.href = contextPath || "/";
},
cometServer: null,
cometOnError: function(e) {
Expand Down Expand Up @@ -602,8 +602,8 @@
},
calcAjaxUrl: calcAjaxUrl,
registerComets: registerComets,
cometOnSessionLost: function() {
settings.cometOnSessionLost();
cometOnSessionLost: function(contextPath) {
settings.cometOnSessionLost(contextPath);
},
cometOnError: function(e) {
settings.cometOnError(e);
Expand Down Expand Up @@ -711,7 +711,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 +722,7 @@
event.stopPropagation();
}
}

return result;
}

Expand Down
2 changes: 1 addition & 1 deletion web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,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.replace("'", "\\'")}')")
) {}

/**
Expand Down

0 comments on commit dfab883

Please sign in to comment.