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 --- .../jquery/src/css/defaultDisplay.js | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 source/bower_components/jquery/src/css/defaultDisplay.js (limited to 'source/bower_components/jquery/src/css/defaultDisplay.js') diff --git a/source/bower_components/jquery/src/css/defaultDisplay.js b/source/bower_components/jquery/src/css/defaultDisplay.js new file mode 100644 index 0000000..631b9ba --- /dev/null +++ b/source/bower_components/jquery/src/css/defaultDisplay.js @@ -0,0 +1,70 @@ +define([ + "../core", + "../manipulation" // appendTo +], function( jQuery ) { + +var iframe, + elemdisplay = {}; + +/** + * Retrieve the actual display of a element + * @param {String} name nodeName of the element + * @param {Object} doc Document object + */ +// Called only from within defaultDisplay +function actualDisplay( name, doc ) { + var style, + elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), + + // getDefaultComputedStyle might be reliably used only on attached element + display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? + + // Use of this method is a temporary fix (more like optmization) until something better comes along, + // since it was removed from specification and supported only in FF + style.display : jQuery.css( elem[ 0 ], "display" ); + + // We don't have any data stored on the element, + // so use "detach" method as fast way to get rid of the element + elem.detach(); + + return display; +} + +/** + * Try to determine the default display value of an element + * @param {String} nodeName + */ +function defaultDisplay( nodeName ) { + var doc = document, + display = elemdisplay[ nodeName ]; + + if ( !display ) { + display = actualDisplay( nodeName, doc ); + + // If the simple way fails, read from inside an iframe + if ( display === "none" || !display ) { + + // Use the already-created iframe if possible + iframe = (iframe || jQuery( "