From 04bd18e38e2d18ab5dc5f1b8f9bf9056e4e7f943 Mon Sep 17 00:00:00 2001 From: Brad Dunbar Date: Tue, 15 May 2012 17:45:36 -0400 Subject: [PATCH] Jettison setDomLibrary in favor of Backbone.$. --- backbone.js | 27 ++++++----------- index.html | 67 +++++++++++++++++++------------------------ test/setdomlibrary.js | 31 -------------------- test/test.html | 1 - 4 files changed, 38 insertions(+), 88 deletions(-) delete mode 100644 test/setdomlibrary.js diff --git a/backbone.js b/backbone.js index bab8a7fd..383ecdd7 100644 --- a/backbone.js +++ b/backbone.js @@ -38,16 +38,7 @@ if (!_ && (typeof require !== 'undefined')) _ = require('underscore'); // For Backbone's purposes, jQuery, Zepto, or Ender owns the `$` variable. - var $ = root.jQuery || root.Zepto || root.ender; - - // Set the JavaScript library that will be used for DOM manipulation and - // Ajax calls (a.k.a. the `$` variable). By default Backbone will use: jQuery, - // Zepto, or Ender; but the `setDomLibrary()` method lets you inject an - // alternate JavaScript library (or a mock library for testing your views - // outside of a browser). - Backbone.setDomLibrary = function(lib) { - $ = lib; - }; + Backbone.$ = root.jQuery || root.Zepto || root.ender; // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable // to its previous owner. Returns a reference to this Backbone object. @@ -1017,16 +1008,16 @@ var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7)); if (oldIE && this._wantsHashChange) { - this.iframe = $('