Permalink
Browse files

adding autohide option

  • Loading branch information...
1 parent 47dc0d9 commit d9a2ca3fa13f2e875fb821f2d4a484e8374be986 @mkrisher committed Oct 26, 2009
Showing with 7 additions and 1 deletion.
  1. +2 −1 lib/qunit_for_rails.rb
  2. +5 −0 public/javascripts/qunit_for_rails.js
@@ -1,12 +1,13 @@
module QunitForRails
- def include_qunit
+ def include_qunit(options = { :autohide => false })
# write to the head of application.html.erb
# include the js and css files required, if RAILS_ENV = development
str = "
<script language=\"JavaScript\">
$list = \"#{list_tests}\";
$list = $list.split(\",\");
$collection = \"#{collect_tests}\";
+ $autohide = \"#{options[:autohide]}\";
</script>
<script type=\"text/javascript\" src=\"/javascripts/qunit.js\"></script>
<script type=\"text/javascript\" src=\"/javascripts/qunit_for_rails.js\"></script>
@@ -76,6 +76,11 @@ if (typeof jQuery == 'undefined') {
$("#qunit-test-select option:contains(all)").attr("selected", true);
$("#qunit-test-select").change();
});
+
+ if ($autohide == "true") {
+ console.log("autohide is true");
+ $('#qunit-overlay').toggle();
+ }
});
}

0 comments on commit d9a2ca3

Please sign in to comment.