Skip to content

Instantly share code, notes, and snippets.

@sgruhier
Created July 16, 2011 10:14
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgruhier/1086231 to your computer and use it in GitHub Desktop.
Save sgruhier/1086231 to your computer and use it in GitHub Desktop.
override jquery UI widget method
// If you dont need to call original method
$.widget("ui.addresspicker", $.extend({}, $.ui.addresspicker.prototype, {
_updatePosition: function(){
// Do what you want to
}
}));
// If you need to call original method
var _updatePosition = $.ui.addresspicker.prototype._updatePosition;
$.widget("ui.addresspicker", $.extend({}, $.ui.addresspicker.prototype, {
_updatePosition: function(){
// Do what you want to
// Call original widget method
_updatePosition.apply(this, arguments);
}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment