Permalink
Browse files

Dradis3 layout: include controller name in <body>

* This lets us scope both CSS and JS code to a specific page. Currently the
code in upload.js was converting every form in the site to Ajax-enabled. Now we
can decide what form to act on.
  • Loading branch information...
1 parent aa6b6c0 commit 28cf0d2ae34fe29a763d78c7f8afaaf029761104 @etdsoft etdsoft committed Jan 28, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 app/assets/javascripts/upload.js
  2. +1 −1 app/views/layouts/dradis3.html.erb
@@ -1,5 +1,5 @@
$(function(){
- $('form').ajaxForm({dataType: 'script'});
+ $('body.upload form').ajaxForm({dataType: 'script'});
$(':file').change(function(){
$('#files').empty();
@@ -9,7 +9,7 @@
<%= csrf_meta_tag %>
</head>
- <body>
+ <body class="<%= controller_name %>">
<div class="content">
<noscript><div class="error">Please enable JavaScript support.</div></noscript>
<% flash.each do |name, msg| %>

0 comments on commit 28cf0d2

Please sign in to comment.