Sha256: e031fb8c0ca3c81276d0c01490bcff1366bcec5ed64f6901b6a5c229dfd0829f
Contents?: true
Size: 912 Bytes
Versions: 26
Compression:
Stored size: 912 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(); } }, listeners: function () { var listeners = []; if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) { // Turbolinks 5 if (Turbolinks.BrowserAdapter) { listeners.push('turbolinks:load'); } else { // Turbolinks < 5 listeners.push('page:load', 'ready'); } } else { listeners.push('ready'); } return listeners.join(' '); } }; }(); // turbolinks triggers page:load events on page transition // If app isn't using turbolinks, this event will never be triggered, no prob. $(document).on(Blacklight.listeners(), function() { Blacklight.activate(); });
Version data entries
26 entries across 26 versions & 1 rubygems