Replace element.data(...) with $.data(element, ...). Fixes #5756 - Widget: Use $.data instead of .data for performance reasons

This commit is contained in:
jzaefferer 2010-07-30 14:04:11 +02:00
parent 39f0c1010a
commit b3940d2f78

View File

@ -129,7 +129,8 @@ $.Widget.prototype = {
_createWidget: function( options, element ) {
// $.widget.bridge stores the plugin instance, but we do it anyway
// so that it's stored even before the _create function runs
this.element = $( element ).data( this.widgetName, this );
$.data( element, this.widgetName, this );
this.element = $( element );
this.options = $.extend( true, {},
this.options,
$.metadata && $.metadata.get( element )[ this.widgetName ],