Skip to content

Commit b3940d2

Browse files
committed
Replace element.data(...) with $.data(element, ...). Fixes #5756 - Widget: Use $.data instead of .data for performance reasons
1 parent 39f0c10 commit b3940d2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ui/jquery.ui.widget.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ $.Widget.prototype = {
129129
_createWidget: function( options, element ) {
130130
// $.widget.bridge stores the plugin instance, but we do it anyway
131131
// so that it's stored even before the _create function runs
132-
this.element = $( element ).data( this.widgetName, this );
132+
$.data( element, this.widgetName, this );
133+
this.element = $( element );
133134
this.options = $.extend( true, {},
134135
this.options,
135136
$.metadata && $.metadata.get( element )[ this.widgetName ],

0 commit comments

Comments
 (0)