Browse files

changing where the js is installed, changed hide to x, change annooun…

…cment id to class in js
  • Loading branch information...
1 parent 6d78e7f commit aa8d798071f59d5d3f729923a75eb4fff585cf9f @chaserx committed Apr 12, 2012
View
4 app/views/announcements/_announcement_for_all.html.erb
@@ -1,6 +1,6 @@
<% if current_announcement.exists? and not announcement_hidden?(current_announcement) %>
- <div class="alert alert-block">
- <%= link_to_function "hide", "hideAnnouncement('announcement_#{current_announcement.created_at}');", :class => "close", :html => {"data-dismiss" => "alert"} %>
+ <div class="alert alert-block announcement">
+ <%= link_to_function "x", "hideAnnouncement('announcement_#{current_announcement.created_at}');", :class => "close", :html => {"data-dismiss" => "alert"} %>
<h4 class="alert-heading">Warning!</h4>
<span><%= current_announcement.body.html_safe %></span>
</div>
View
2 lib/generators/paul_revere/paul_revere_generator.rb
@@ -8,7 +8,7 @@ class PaulRevereGenerator < Rails::Generators::Base
source_root File.join(File.dirname(__FILE__), "templates")
def install
- copy_file "announcements.js", "public/javascripts/announcements.js"
+ copy_file "announcements.js", "app/assets/javascripts/announcements.js"
migration_template "migration.rb", "db/migrate/create_announcements.rb"
end
end
View
2 lib/generators/paul_revere/templates/announcements.js
@@ -1,6 +1,6 @@
function hideAnnouncement(announcement_created_at) {
createCookie(announcement_created_at, 'hidden', 365);
- $("#announcement").parent().slideUp();
+ $(".announcement").parent().slideUp();
}
// http://www.quirksmode.org/js/cookies.html

0 comments on commit aa8d798

Please sign in to comment.