Browse files

Add jQuery plugin on page load, not domready

The phileo plugin was added to jQuery in the domready event callback. As
this plugin could be loaded at the bottom of a page - AFTER phileo
widget scripts - it was possible for the phileo plugin to not be
loaded when the widgets were initialized in the domready event. As the
phileo plugin does not need the DOM to be ready to set itself up, the
plugin now loads as the page is loading. This allows phileo widgets to
be inserted before the phileo plugin script and for everything to still
  • Loading branch information...
Tim Heap
Tim Heap committed Dec 1, 2011
1 parent 72aed02 commit 388c801a19181812879815789855328a804f1e78
Showing with 3 additions and 2 deletions.
  1. +3 −2 phileo/static/phileo/js/jquery.phileo.js
@@ -1,4 +1,5 @@
-jQuery(function($) {
+ "use strict";
var PhileoLikes = function(form, options) {
this.options = $.extend({}, $.fn.phileo.defaults, options);
@@ -36,4 +37,4 @@ jQuery(function($) {
toggle_class: 'phileo-liked',
count: false
+}( window.jQuery || window.ender );

0 comments on commit 388c801

Please sign in to comment.