Sha256: 932af0cf61db52381f11de830cdae4b920e36c303015e6538faea1348238bdd8
Contents?: true
Size: 881 Bytes
Versions: 13
Compression:
Stored size: 881 Bytes
Contents
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('ready') is deprecated in JQuery 1.8 if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) { // Turbolinks 5 if (Turbolinks.BrowserAdapter) { $(document).on('turbolinks:load', function() { Blacklight.activate(); }); } else { // Turbolinks < 5 $(document).on('page:load', function() { Blacklight.activate(); }); $(document).ready(function() { Blacklight.activate(); }); } } else { $(document).ready(function() { Blacklight.activate(); }); }
Version data entries
13 entries across 13 versions & 1 rubygems