wp/wp-includes/js/jquery/ui/checkboxradio.js
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
     1 /*!
     1 /*!
     2  * jQuery UI Checkboxradio 1.12.1
     2  * jQuery UI Checkboxradio 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
    16 //>>css.structure: ../../themes/base/button.css
    16 //>>css.structure: ../../themes/base/button.css
    17 //>>css.structure: ../../themes/base/checkboxradio.css
    17 //>>css.structure: ../../themes/base/checkboxradio.css
    18 //>>css.theme: ../../themes/base/theme.css
    18 //>>css.theme: ../../themes/base/theme.css
    19 
    19 
    20 ( function( factory ) {
    20 ( function( factory ) {
       
    21 	"use strict";
       
    22 
    21 	if ( typeof define === "function" && define.amd ) {
    23 	if ( typeof define === "function" && define.amd ) {
    22 
    24 
    23 		// AMD. Register as an anonymous module.
    25 		// AMD. Register as an anonymous module.
    24 		define( [
    26 		define( [
    25 			"jquery",
    27 			"jquery",
    28 	} else {
    30 	} else {
    29 
    31 
    30 		// Browser globals
    32 		// Browser globals
    31 		factory( jQuery );
    33 		factory( jQuery );
    32 	}
    34 	}
    33 }( function( $ ) {
    35 } )( function( $ ) {
       
    36 "use strict";
    34 
    37 
    35 $.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
    38 $.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
    36 	version: "1.12.1",
    39 	version: "1.13.1",
    37 	options: {
    40 	options: {
    38 		disabled: null,
    41 		disabled: null,
    39 		label: null,
    42 		label: null,
    40 		icon: true,
    43 		icon: true,
    41 		classes: {
    44 		classes: {
   110 
   113 
   111 		this._enhance();
   114 		this._enhance();
   112 
   115 
   113 		if ( checked ) {
   116 		if ( checked ) {
   114 			this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" );
   117 			this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" );
   115 			if ( this.icon ) {
       
   116 				this._addClass( this.icon, null, "ui-state-hover" );
       
   117 			}
       
   118 		}
   118 		}
   119 
   119 
   120 		this._on( {
   120 		this._on( {
   121 			change: "_toggleClasses",
   121 			change: "_toggleClasses",
   122 			focus: function() {
   122 			focus: function() {
   147 	},
   147 	},
   148 
   148 
   149 	_getRadioGroup: function() {
   149 	_getRadioGroup: function() {
   150 		var group;
   150 		var group;
   151 		var name = this.element[ 0 ].name;
   151 		var name = this.element[ 0 ].name;
   152 		var nameSelector = "input[name='" + $.ui.escapeSelector( name ) + "']";
   152 		var nameSelector = "input[name='" + $.escapeSelector( name ) + "']";
   153 
   153 
   154 		if ( !name ) {
   154 		if ( !name ) {
   155 			return $( [] );
   155 			return $( [] );
   156 		}
   156 		}
   157 
   157 
   159 			group = $( this.form[ 0 ].elements ).filter( nameSelector );
   159 			group = $( this.form[ 0 ].elements ).filter( nameSelector );
   160 		} else {
   160 		} else {
   161 
   161 
   162 			// Not inside a form, check all inputs that also are not inside a form
   162 			// Not inside a form, check all inputs that also are not inside a form
   163 			group = $( nameSelector ).filter( function() {
   163 			group = $( nameSelector ).filter( function() {
   164 				return $( this ).form().length === 0;
   164 				return $( this )._form().length === 0;
   165 			} );
   165 			} );
   166 		}
   166 		}
   167 
   167 
   168 		return group.not( this.element );
   168 		return group.not( this.element );
   169 	},
   169 	},
   278 
   278 
   279 } ] );
   279 } ] );
   280 
   280 
   281 return $.ui.checkboxradio;
   281 return $.ui.checkboxradio;
   282 
   282 
   283 } ) );
   283 } );