mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
7537bab562
commit
d84c5a7c1d
226 changed files with 51770 additions and 4157 deletions
|
@ -1,68 +1,83 @@
|
|||
define([
|
||||
define( [
|
||||
"../core",
|
||||
"../core/access",
|
||||
"./support"
|
||||
"./support",
|
||||
"../selector"
|
||||
], function( jQuery, access, support ) {
|
||||
|
||||
var rfocusable = /^(?:input|select|textarea|button)$/i;
|
||||
var rfocusable = /^(?:input|select|textarea|button)$/i,
|
||||
rclickable = /^(?:a|area)$/i;
|
||||
|
||||
jQuery.fn.extend({
|
||||
jQuery.fn.extend( {
|
||||
prop: function( name, value ) {
|
||||
return access( this, jQuery.prop, name, value, arguments.length > 1 );
|
||||
},
|
||||
|
||||
removeProp: function( name ) {
|
||||
return this.each(function() {
|
||||
return this.each( function() {
|
||||
delete this[ jQuery.propFix[ name ] || name ];
|
||||
});
|
||||
} );
|
||||
}
|
||||
});
|
||||
|
||||
jQuery.extend({
|
||||
propFix: {
|
||||
"for": "htmlFor",
|
||||
"class": "className"
|
||||
},
|
||||
} );
|
||||
|
||||
jQuery.extend( {
|
||||
prop: function( elem, name, value ) {
|
||||
var ret, hooks, notxml,
|
||||
var ret, hooks,
|
||||
nType = elem.nodeType;
|
||||
|
||||
// Don't get/set properties on text, comment and attribute nodes
|
||||
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
||||
if ( nType === 3 || nType === 8 || nType === 2 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
||||
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
|
||||
|
||||
if ( notxml ) {
|
||||
// Fix name and attach hooks
|
||||
name = jQuery.propFix[ name ] || name;
|
||||
hooks = jQuery.propHooks[ name ];
|
||||
}
|
||||
|
||||
if ( value !== undefined ) {
|
||||
return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
|
||||
ret :
|
||||
( elem[ name ] = value );
|
||||
if ( hooks && "set" in hooks &&
|
||||
( ret = hooks.set( elem, value, name ) ) !== undefined ) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
} else {
|
||||
return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
|
||||
ret :
|
||||
elem[ name ];
|
||||
return ( elem[ name ] = value );
|
||||
}
|
||||
|
||||
if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
return elem[ name ];
|
||||
},
|
||||
|
||||
propHooks: {
|
||||
tabIndex: {
|
||||
get: function( elem ) {
|
||||
return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
|
||||
elem.tabIndex :
|
||||
-1;
|
||||
|
||||
// elem.tabIndex doesn't always return the
|
||||
// correct value when it hasn't been explicitly set
|
||||
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
|
||||
// Use proper attribute retrieval(#12072)
|
||||
var tabindex = jQuery.find.attr( elem, "tabindex" );
|
||||
|
||||
return tabindex ?
|
||||
parseInt( tabindex, 10 ) :
|
||||
rfocusable.test( elem.nodeName ) ||
|
||||
rclickable.test( elem.nodeName ) && elem.href ?
|
||||
0 :
|
||||
-1;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
propFix: {
|
||||
"for": "htmlFor",
|
||||
"class": "className"
|
||||
}
|
||||
});
|
||||
} );
|
||||
|
||||
if ( !support.optSelected ) {
|
||||
jQuery.propHooks.selected = {
|
||||
|
@ -76,7 +91,7 @@ if ( !support.optSelected ) {
|
|||
};
|
||||
}
|
||||
|
||||
jQuery.each([
|
||||
jQuery.each( [
|
||||
"tabIndex",
|
||||
"readOnly",
|
||||
"maxLength",
|
||||
|
@ -89,6 +104,6 @@ jQuery.each([
|
|||
"contentEditable"
|
||||
], function() {
|
||||
jQuery.propFix[ this.toLowerCase() ] = this;
|
||||
});
|
||||
} );
|
||||
|
||||
});
|
||||
} );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue