From 698e63d9a3a1d5ff6e687ba925d27983bbe74986 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Sun, 3 Mar 2013 19:38:19 +0000 Subject: [PATCH] fix popFrame --- lib/capybara/poltergeist/client/compiled/web_page.js | 6 +----- lib/capybara/poltergeist/client/web_page.coffee | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/capybara/poltergeist/client/compiled/web_page.js b/lib/capybara/poltergeist/client/compiled/web_page.js index 30743032..4640818c 100644 --- a/lib/capybara/poltergeist/client/compiled/web_page.js +++ b/lib/capybara/poltergeist/client/compiled/web_page.js @@ -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) { diff --git a/lib/capybara/poltergeist/client/web_page.coffee b/lib/capybara/poltergeist/client/web_page.coffee index 3957c793..cc21ebb5 100644 --- a/lib/capybara/poltergeist/client/web_page.coffee +++ b/lib/capybara/poltergeist/client/web_page.coffee @@ -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]