Skip to content

Commit

Permalink
fix popFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
jonleighton committed Mar 3, 2013
1 parent 3d0e86c commit 698e63d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions lib/capybara/poltergeist/client/compiled/web_page.js
Expand Up @@ -232,11 +232,7 @@ Poltergeist.WebPage = (function() {

WebPage.prototype.popFrame = function() {
this.frames.pop();
if (this.frames.length === 0) {
return this["native"].switchToMainFrame();
} else {
return this["native"].switchToFrame(this.frames[this.frames.length - 1]);
}
return this["native"].switchToParentFrame();
};

WebPage.prototype.getPage = function(name) {
Expand Down
6 changes: 1 addition & 5 deletions lib/capybara/poltergeist/client/web_page.coffee
Expand Up @@ -158,11 +158,7 @@ class Poltergeist.WebPage

popFrame: ->
@frames.pop()

if @frames.length == 0
@native.switchToMainFrame()
else
@native.switchToFrame(@frames[@frames.length - 1])
@native.switchToParentFrame()

getPage: (name) ->
if @sub_pages[name]
Expand Down

0 comments on commit 698e63d

Please sign in to comment.