Skip to content

Commit

Permalink
Add noConflict method for jQuery plugin. Fixes #612.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Harding committed Feb 2, 2014
1 parent 94baabb commit dcf3f68
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/typeahead/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
*/

(function() {
var typeaheadKey, methods;
var old, typeaheadKey, methods;

old = jQuery.fn.typeahead;

typeaheadKey = 'ttTypeahead';

Expand Down Expand Up @@ -116,4 +118,9 @@
return methods.initialize.apply(this, arguments);
}
};

jQuery.fn.typeahead.noConflict = function noConflict() {
jQuery.fn.typeahead = old;
return this;
};
})();

1 comment on commit dcf3f68

@zoldello
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

Please sign in to comment.