Created
March 11, 2016 17:26
-
-
Save julesbou/19c5e2ed932febb044cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// save a reference to $() method | |
var view$ = Backbone.View.prototype.$; | |
// then override it | |
Backbone.View.prototype.$ = function(selector) { | |
var element = view$.apply(this, arguments); | |
if (!element.length === 0) { | |
console.error("[Backbone.View] Warning: selector '" + selector + "' do not match any element"); | |
} | |
return element; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment