From 7cc7910df63d19e7ebc67bb1156437f0559712d7 Mon Sep 17 00:00:00 2001 From: Lars Henrik Mai Date: Sun, 21 Sep 2014 12:25:47 +0200 Subject: add foundation via bower --- .../bower_components/jquery/src/attributes/prop.js | 96 ++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 source/bower_components/jquery/src/attributes/prop.js (limited to 'source/bower_components/jquery/src/attributes/prop.js') diff --git a/source/bower_components/jquery/src/attributes/prop.js b/source/bower_components/jquery/src/attributes/prop.js new file mode 100644 index 0000000..e2b95dc --- /dev/null +++ b/source/bower_components/jquery/src/attributes/prop.js @@ -0,0 +1,96 @@ +define([ + "../core", + "../core/access", + "./support" +], function( jQuery, access, support ) { + +var rfocusable = /^(?:input|select|textarea|button)$/i; + +jQuery.fn.extend({ + prop: function( name, value ) { + return access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + return this.each(function() { + delete this[ jQuery.propFix[ name ] || name ]; + }); + } +}); + +jQuery.extend({ + propFix: { + "for": "htmlFor", + "class": "className" + }, + + prop: function( elem, name, value ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set properties on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + notxml = 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 ); + + } else { + return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? + ret : + elem[ name ]; + } + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ? + elem.tabIndex : + -1; + } + } + } +}); + +// Support: IE9+ +// Selectedness for an option in an optgroup can be inaccurate +if ( !support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + var parent = elem.parentNode; + if ( parent && parent.parentNode ) { + parent.parentNode.selectedIndex; + } + return null; + } + }; +} + +jQuery.each([ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +}); + +}); -- cgit v1.2.1