Skip to content

Instantly share code, notes, and snippets.

@s-mage
Created November 1, 2013 13:23
Show Gist options
  • Save s-mage/7265370 to your computer and use it in GitHub Desktop.
Save s-mage/7265370 to your computer and use it in GitHub Desktop.
%h2.expandall Expand/Collapse All
- @tag.pages.each do |page|
%div{ class: 'title', id: "title_#{page.title}" }
= page.pretty_title
= link_to(" [edit]", controller: 'wiki', action: 'show', |
project_id: page.project, id: page.title)
%div{ class: 'section', id: page.title }
= raw Redmine::WikiFormatting::Textile::Formatter.new(page.text).to_html
:javascript
$('div#title_#{page.title}').click(function() {
$('div##{page.title}').slideToggle('fast');
$('div#title_#{page.title}').slideToggle('fast');
});
$('div##{page.title}').click(function() {
$('div##{page.title}').slideToggle('fast');
$('div#title_#{page.title}').slideToggle('fast');
});
%h2.expandall Expand/Collapse All
:javascript
$('div.section').slideUp('fast');
$('.expandall').click(function() {
$('div.section').slideToggle('fast');
$('div.title').slideToggle('fast');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment