wp/wp-includes/js/jquery/ui/controlgroup.js
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
     1 /*!
     1 /*!
     2  * jQuery UI Controlgroup 1.12.1
     2  * jQuery UI Controlgroup 1.13.1
     3  * http://jqueryui.com
     3  * http://jqueryui.com
     4  *
     4  *
     5  * Copyright jQuery Foundation and other contributors
     5  * Copyright jQuery Foundation and other contributors
     6  * Released under the MIT license.
     6  * Released under the MIT license.
     7  * http://jquery.org/license
     7  * http://jquery.org/license
    15 //>>css.structure: ../../themes/base/core.css
    15 //>>css.structure: ../../themes/base/core.css
    16 //>>css.structure: ../../themes/base/controlgroup.css
    16 //>>css.structure: ../../themes/base/controlgroup.css
    17 //>>css.theme: ../../themes/base/theme.css
    17 //>>css.theme: ../../themes/base/theme.css
    18 
    18 
    19 ( function( factory ) {
    19 ( function( factory ) {
       
    20 	"use strict";
       
    21 
    20 	if ( typeof define === "function" && define.amd ) {
    22 	if ( typeof define === "function" && define.amd ) {
    21 
    23 
    22 		// AMD. Register as an anonymous module.
    24 		// AMD. Register as an anonymous module.
    23 		define( [
    25 		define( [
    24 			"jquery",
    26 			"jquery",
    27 	} else {
    29 	} else {
    28 
    30 
    29 		// Browser globals
    31 		// Browser globals
    30 		factory( jQuery );
    32 		factory( jQuery );
    31 	}
    33 	}
    32 }( function( $ ) {
    34 } )( function( $ ) {
       
    35 "use strict";
       
    36 
    33 var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g;
    37 var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g;
    34 
    38 
    35 return $.widget( "ui.controlgroup", {
    39 return $.widget( "ui.controlgroup", {
    36 	version: "1.12.1",
    40 	version: "1.13.1",
    37 	defaultElement: "<div>",
    41 	defaultElement: "<div>",
    38 	options: {
    42 	options: {
    39 		direction: "horizontal",
    43 		direction: "horizontal",
    40 		disabled: null,
    44 		disabled: null,
    41 		onlyVisible: true,
    45 		onlyVisible: true,
   148 
   152 
   149 					childWidgets.push( widgetElement[ 0 ] );
   153 					childWidgets.push( widgetElement[ 0 ] );
   150 				} );
   154 				} );
   151 		} );
   155 		} );
   152 
   156 
   153 		this.childWidgets = $( $.unique( childWidgets ) );
   157 		this.childWidgets = $( $.uniqueSort( childWidgets ) );
   154 		this._addClass( this.childWidgets, "ui-controlgroup-item" );
   158 		this._addClass( this.childWidgets, "ui-controlgroup-item" );
   155 	},
   159 	},
   156 
   160 
   157 	_callChildMethod: function( method ) {
   161 	_callChildMethod: function( method ) {
   158 		this.childWidgets.each( function() {
   162 		this.childWidgets.each( function() {
   232 
   236 
   233 	_resolveClassesValues: function( classes, instance ) {
   237 	_resolveClassesValues: function( classes, instance ) {
   234 		var result = {};
   238 		var result = {};
   235 		$.each( classes, function( key ) {
   239 		$.each( classes, function( key ) {
   236 			var current = instance.options.classes[ key ] || "";
   240 			var current = instance.options.classes[ key ] || "";
   237 			current = $.trim( current.replace( controlgroupCornerRegex, "" ) );
   241 			current = String.prototype.trim.call( current.replace( controlgroupCornerRegex, "" ) );
   238 			result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " );
   242 			result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " );
   239 		} );
   243 		} );
   240 		return result;
   244 		return result;
   241 	},
   245 	},
   242 
   246 
   293 			// Finally call the refresh method on each of the child widgets.
   297 			// Finally call the refresh method on each of the child widgets.
   294 			this._callChildMethod( "refresh" );
   298 			this._callChildMethod( "refresh" );
   295 		}
   299 		}
   296 	}
   300 	}
   297 } );
   301 } );
   298 } ) );
   302 } );