getdave / Tanlinell

Boilerplate Wordpress theme for rapid development of new WP themes. Based on the great work of the _s ("Underscore") theme.
GNU General Public License v2.0
6 stars 2 forks source link

Fix path to local jQuery fallback #273

Closed getdave closed 10 years ago

getdave commented 10 years ago

Local jQuery fallback has an unwanted extra slash in the path. Amend to:

echo '<script>window.jQuery || document.write(\'<script src="' . $url . 'js/jquery/jquery.js"><\/script>\')</script>' . "\n";

As a result of this version of jQuery load in compatibility mode by default we need to ensure all Global JS helpers have access to $ as jQuery. Involves ensuring all are wrapped in this pattern

(function($) {

}(jQuery));

For example

SITE.utils.activeMQ = (function($) {
    var lookup = {
        'none': 1,
        'tiny': 2,
        'small': 3,
        'medium': 4,
        'large': 5,
        'x-large': 6
    };

    var mqString = $(":root").css("font-family");
    return lookup[mqString];
}(jQuery));
getdave commented 10 years ago

Fixed in feature branch. Will close via commit.