app/assets/javascripts/jquery-ui/widgets/tabs.js in jquery-ui-rails-6.0.1 vs app/assets/javascripts/jquery-ui/widgets/tabs.js in jquery-ui-rails-7.0.0

- old
+ new

@@ -1,14 +1,13 @@ -//= require jquery-ui/escape-selector //= require jquery-ui/keycode //= require jquery-ui/safe-active-element //= require jquery-ui/unique-id //= require jquery-ui/version //= require jquery-ui/widget /*! - * jQuery UI Tabs 1.12.1 + * jQuery UI Tabs 1.13.0 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license @@ -22,16 +21,17 @@ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/tabs.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", - "../escape-selector", "../keycode", "../safe-active-element", "../unique-id", "../version", "../widget" @@ -39,14 +39,15 @@ } else { // Browser globals factory( jQuery ); } -}( function( $ ) { +} )( function( $ ) { +"use strict"; $.widget( "ui.tabs", { - version: "1.12.1", + version: "1.13.0", delay: 300, options: { active: null, classes: { "ui-tabs": "ui-corner-all", @@ -100,12 +101,12 @@ this._processTabs(); options.active = this._initialActive(); // Take disabling tabs via class attribute from HTML // into account and update option properly. - if ( $.isArray( options.disabled ) ) { - options.disabled = $.unique( options.disabled.concat( + if ( Array.isArray( options.disabled ) ) { + options.disabled = $.uniqueSort( options.disabled.concat( $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) { return that.tabs.index( li ); } ) ) ).sort(); } @@ -436,11 +437,10 @@ this.anchors = this.tabs.map( function() { return $( "a", this )[ 0 ]; } ) .attr( { - role: "presentation", tabIndex: -1 } ); this._addClass( this.anchors, "ui-tabs-anchor" ); this.panels = $(); @@ -508,11 +508,11 @@ }, _setOptionDisabled: function( disabled ) { var currentItem, li, i; - if ( $.isArray( disabled ) ) { + if ( Array.isArray( disabled ) ) { if ( !disabled.length ) { disabled = false; } else if ( disabled.length === this.anchors.length ) { disabled = true; } @@ -739,11 +739,11 @@ _getIndex: function( index ) { // meta-function to give users option to provide a href string instead of a numerical index. if ( typeof index === "string" ) { index = this.anchors.index( this.anchors.filter( "[href$='" + - $.ui.escapeSelector( index ) + "']" ) ); + $.escapeSelector( index ) + "']" ) ); } return index; }, @@ -796,11 +796,11 @@ if ( index === undefined ) { disabled = false; } else { index = this._getIndex( index ); - if ( $.isArray( disabled ) ) { + if ( Array.isArray( disabled ) ) { disabled = $.map( disabled, function( num ) { return num !== index ? num : null; } ); } else { disabled = $.map( this.tabs, function( li, num ) { @@ -822,11 +822,11 @@ } else { index = this._getIndex( index ); if ( $.inArray( index, disabled ) !== -1 ) { return; } - if ( $.isArray( disabled ) ) { + if ( Array.isArray( disabled ) ) { disabled = $.merge( [ index ], disabled ).sort(); } else { disabled = [ index ]; } } @@ -926,6 +926,6 @@ } ); } return $.ui.tabs; -} ) ); +} );