Skip to content

Commit

Permalink
fix(client): Revert back to old reloading detection
Browse files Browse the repository at this point in the history
Ref #1656
  • Loading branch information
dignifiedquire committed Oct 22, 2015
1 parent 7adf5bb commit f1c22d6
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions client/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,14 @@ 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
childWindow = opener('about:blank')
}
childWindow.location = url
childWindow.onLoad = function () {
reloadingContext = false
}
} else {
iframe.src = url
iframe.onLoad = function () {
reloadingContext = false
}
}
}

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

var clearContext = function () {
reloadingContext = true

navigateContextTo('about:blank')
}

Expand Down Expand Up @@ -217,6 +211,7 @@ 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 f1c22d6

Please sign in to comment.