{I" class:ETI"BundledAsset; FI"logical_path; TI"blacklight/ajax_modal.js; FI" pathname; TI"ƒ/Users/audreyaltman/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/blacklight-5.8.2/app/assets/javascripts/blacklight/ajax_modal.js; FI"content_type; TI"application/javascript; TI" mtime; Tl+jѪTI"length; Ti%I"digest; TI"%a645fc66f0744ea3ae95fd9495c15930; FI"source; TI"%Blacklight = function() { var buffer = new Array; return { onLoad: function(func) { buffer.push(func); }, activate: function() { for(var i = 0; i < buffer.length; i++) { buffer[i].call(); } } } }(); // turbolinks triggers page:load events on page transition // If app isn't using turbolinks, this event will never be triggered, no prob. $(document).on('page:load', function() { Blacklight.activate(); }); $(document).ready(function() { Blacklight.activate(); }); /* The ajax_modal plugin can display some interactions inside a Bootstrap modal window, including some multi-page interactions. It supports unobtrusive Javascript, where a link or form that would have caused a new page load is changed to display it's results inside a modal dialog, by this plugin. The plugin assumes there is a Bootstrap modal div on the page with id #ajax-modal to use as the modal -- the standard Blacklight layout provides this. To make a link or form have their results display inside a modal, add `data-ajax-modal="trigger"` to the link or form. (Note, form itself not submit input) With Rails link_to helper, you'd do that like: link_to something, link, :data => {:ajax_modal => "trigger"} The results of the link href or form submit will be displayed inside a modal -- they should include the proper HTML markup for a bootstrap modal's contents. Also, you ordinarily won't want the Rails template with wrapping navigational elements to be used. The Rails controller could suppress the layout when a JS AJAX request is detected, OR the response can include a `
Some message
<%= link_to "This result will still be within modal", some_link, :data => {:ajax_modal => "preserve"} %>