Sha256: 17551586748e0e7084851ea123b33bea1d72907b563e0a0fe6f519d5b8fc00f4

Contents?: true

Size: 1.74 KB

Versions: 14

Compression:

Stored size: 1.74 KB

Contents

//= require jquery-ui/version
//= require jquery-ui/escape-selector

/*!
 * jQuery UI Labels 1.12.1
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 */

//>>label: labels
//>>group: Core
//>>description: Find all the labels associated with a given input
//>>docs: http://api.jqueryui.com/labels/

( function( factory ) {
	if ( typeof define === "function" && define.amd ) {

		// AMD. Register as an anonymous module.
		define( [ "jquery", "./version", "./escape-selector" ], factory );
	} else {

		// Browser globals
		factory( jQuery );
	}
} ( function( $ ) {

return $.fn.labels = function() {
	var ancestor, selector, id, labels, ancestors;

	// Check control.labels first
	if ( this[ 0 ].labels && this[ 0 ].labels.length ) {
		return this.pushStack( this[ 0 ].labels );
	}

	// Support: IE <= 11, FF <= 37, Android <= 2.3 only
	// Above browsers do not support control.labels. Everything below is to support them
	// as well as document fragments. control.labels does not work on document fragments
	labels = this.eq( 0 ).parents( "label" );

	// Look for the label based on the id
	id = this.attr( "id" );
	if ( id ) {

		// We don't search against the document in case the element
		// is disconnected from the DOM
		ancestor = this.eq( 0 ).parents().last();

		// Get a full set of top level ancestors
		ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() );

		// Create a selector for the label based on the id
		selector = "label[for='" + $.ui.escapeSelector( id ) + "']";

		labels = labels.add( ancestors.find( selector ).addBack( selector ) );

	}

	// Return whatever we have found for labels
	return this.pushStack( labels );
};

} ) );

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/jquery-ui-rails-6.0.1/app/assets/javascripts/jquery-ui/labels.js
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/jquery-ui-rails-6.0.1/app/assets/javascripts/jquery-ui/labels.js
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/jquery-ui-rails-6.0.1/app/assets/javascripts/jquery-ui/labels.js
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/jquery-ui-rails-6.0.1/app/assets/javascripts/jquery-ui/labels.js
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/jquery-ui-rails-6.0.1/app/assets/javascripts/jquery-ui/labels.js
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/jquery-ui-rails-6.0.1/app/assets/javascripts/jquery-ui/labels.js
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/jquery-ui-rails-6.0.1/app/assets/javascripts/jquery-ui/labels.js
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/jquery-ui-rails-6.0.1/app/assets/javascripts/jquery-ui/labels.js
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/jquery-ui-rails-6.0.1/app/assets/javascripts/jquery-ui/labels.js
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/jquery-ui-rails-6.0.1/app/assets/javascripts/jquery-ui/labels.js
sn-jquery-ui-rails-6.0.3 app/assets/javascripts/jquery-ui/labels.js
sn-jquery-ui-rails-6.0.2 app/assets/javascripts/jquery-ui/labels.js
jquery-ui-rails-6.0.1 app/assets/javascripts/jquery-ui/labels.js
jquery-ui-rails-6.0.0 app/assets/javascripts/jquery-ui/labels.js