diff options
author | prashantsinalkar | 2019-08-27 12:29:12 +0530 |
---|---|---|
committer | prashantsinalkar | 2019-08-27 12:29:12 +0530 |
commit | b9c709823e26f5b20d3732e1788b871cdd961a03 (patch) | |
tree | a9089f56541854b48ddbda733832a153c6d53927 /static/website/bootstrap-css/bower_components/jquery/src/css/defaultDisplay.js | |
parent | 50e8fc0832d81d124abd7606b15502545bf84b23 (diff) | |
download | SciPy2019-b9c709823e26f5b20d3732e1788b871cdd961a03.tar.gz SciPy2019-b9c709823e26f5b20d3732e1788b871cdd961a03.tar.bz2 SciPy2019-b9c709823e26f5b20d3732e1788b871cdd961a03.zip |
added intial code for project
Diffstat (limited to 'static/website/bootstrap-css/bower_components/jquery/src/css/defaultDisplay.js')
-rw-r--r-- | static/website/bootstrap-css/bower_components/jquery/src/css/defaultDisplay.js | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/static/website/bootstrap-css/bower_components/jquery/src/css/defaultDisplay.js b/static/website/bootstrap-css/bower_components/jquery/src/css/defaultDisplay.js new file mode 100644 index 0000000..046ae91 --- /dev/null +++ b/static/website/bootstrap-css/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 optimization) 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( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement ); + + // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse + doc = iframe[ 0 ].contentDocument; + + // Support: IE + doc.write(); + doc.close(); + + display = actualDisplay( nodeName, doc ); + iframe.detach(); + } + + // Store the correct default display + elemdisplay[ nodeName ] = display; + } + + return display; +} + +return defaultDisplay; + +}); |