Skip to content

Commit

Permalink
Merge pull request #70 from jeffreyguo/pulls/jserror
Browse files Browse the repository at this point in the history
wait for DOM to remove attribute
  • Loading branch information
chillu committed Sep 4, 2014
2 parents 16d5a00 + 8ea9815 commit 6e13a68
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/SilverStripe/BehatExtension/Context/BasicContext.php
Expand Up @@ -114,10 +114,11 @@ public function readErrorHandlerAfterStep(StepEvent $event)
}

$javascript = <<<JS
(function() {
var body = document.getElementsByTagName('body')[0];
body.removeAttribute('data-jserrors');
})();
if ('undefined' !== typeof window.jQuery) {
$(document).ready(function() {
window.jQuery('body').removeAttribute('data-jserrors');
});
}
JS;

$this->getSession()->executeScript($javascript);
Expand Down

0 comments on commit 6e13a68

Please sign in to comment.