From: jzaefferer Date: Fri, 30 Jul 2010 12:04:11 +0000 (+0200) Subject: Replace element.data(...) with $.data(element, ...). Fixes #5756 - Widget: Use $... X-Git-Tag: 1.8.3~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b3940d2f78dfcc37792ceb97e5659b78f156794c;p=jquery-ui.git Replace element.data(...) with $.data(element, ...). Fixes #5756 - Widget: Use $.data instead of .data for performance reasons --- diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 265489866..e21287ae0 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -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 ],