Skip to content

Commit

Permalink
Merge pull request #1648 from FuzzySockets/page-reload-error
Browse files Browse the repository at this point in the history
fix (client/karma): Set reload context flag to avoid full page reload
  • Loading branch information
dignifiedquire committed Oct 22, 2015
2 parents b138619 + 033caad commit ad18ce3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/karma.js
Expand Up @@ -24,6 +24,7 @@ var Karma = function (socket, iframe, opener, navigator, location) {

var childWindow = null
var navigateContextTo = function (url) {
reloadingContext = true
if (self.config.useIframe === false) {
if (childWindow === null || childWindow.closed === true) {
// If this is the first time we are opening the window, or the window is closed
Expand All @@ -33,6 +34,7 @@ var Karma = function (socket, iframe, opener, navigator, location) {
} else {
iframe.src = url
}
reloadingContext = false
}

this.setupContext = function (contextWindow) {
Expand Down Expand Up @@ -105,7 +107,6 @@ var Karma = function (socket, iframe, opener, navigator, location) {
this.stringify = stringify

var clearContext = function () {
reloadingContext = true
navigateContextTo('about:blank')
}

Expand Down Expand Up @@ -210,7 +211,6 @@ var Karma = function (socket, iframe, opener, navigator, location) {
// reset hasError and reload the iframe
hasError = false
startEmitted = false
reloadingContext = false
self.config = cfg
navigateContextTo(constant.CONTEXT_URL)

Expand Down

0 comments on commit ad18ce3

Please sign in to comment.