Skip to content

Instantly share code, notes, and snippets.

@amdest
amdest / gist:2935783
Created June 15, 2012 10:35
Twitter Bootstrap modal auto-width
// https://github.com/twitter/bootstrap/issues/675#issuecomment-6184243
$('#feedback-modal').modal({
backdrop: true,
keyboard: true
}).css({
'width': function () {
return ($(document).width() * .9) + 'px';
},
'margin-left': function () {
@amdest
amdest / refinery_nav.html.erb
Created March 26, 2012 18:45
Rails & Refinery CMS: navigation
<nav id='<%= dom_id %>' class='<%= css %>'>
<ul>
<%= render :partial => '/refinery/menu_branch', :collection => roots,
:locals => {
:hide_children => hide_children,
:sibling_count => (roots.length - 1),
:apply_css => true #if you don't care about class='first' class='last' or class='selected' set apply_css to false for speed.
} -%>
</ul>
</nav>