js/freeboard.thirdparty.js
function( element ) {

		// if the element is already wrapped, return it
		if ( element.parent().is( ".ui-effects-wrapper" )) {
			return element.parent();
		}

		// wrap the element
		var props = {
				width: element.outerWidth(true),
				height: element.outerHeight(true),
				"float": element.css( "float" )
			},
			wrapper = $( "<div></div>" )
				.addClass( "ui-effects-wrapper" )
				.css({
					fontSize: "100%",
					background: "transparent",
					border: "none",
					margin: 0,
					padding: 0
				}),
			// Store the size in case width/height are defined in % - Fixes #5245
			size = {
				width: element.width(),
				height: element.height()
			},
			active = document.activeElement;

		// support: Firefox
		// Firefox incorrectly exposes anonymous content
		// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
		try {
			active.id;
		} catch( e ) {
			active = document.body;
		}

		element.wrap( wrapper );

		// Fixes #7595 - Elements lose focus when wrapped.
		if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
			$( active ).focus();
		}

		wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element

		// transfer positioning properties to the wrapper
		if ( element.css( "position" ) === "static" ) {
			wrapper.css({ position: "relative" });
			element.css({ position: "relative" });
		} else {
			$.extend( props, {
				position: element.css( "position" ),
				zIndex: element.css( "z-index" )
			});
			$.each([ "top", "left", "bottom", "right" ], function(i, pos) {
				props[ pos ] = element.css( pos );
				if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
					props[ pos ] = "auto";
				}
			});
			element.css({
				position: "relative",
				top: 0,
				left: 0,
				right: "auto",
				bottom: "auto"
			});
		}
		element.css(size);

		return wrapper.css( props ).show();
	}
function( element ) {

		// if the element is already wrapped, return it
		if ( element.parent().is( ".ui-effects-wrapper" )) {
			return element.parent();
		}

		// wrap the element
		var props = {
				width: element.outerWidth(true),
				height: element.outerHeight(true),
				"float": element.css( "float" )
			},
			wrapper = $( "<div></div>" )
				.addClass( "ui-effects-wrapper" )
				.css({
					fontSize: "100%",
					background: "transparent",
					border: "none",
					margin: 0,
					padding: 0
				}),
			// Store the size in case width/height are defined in % - Fixes #5245
			size = {
				width: element.width(),
				height: element.height()
			},
			active = document.activeElement;

		// support: Firefox
		// Firefox incorrectly exposes anonymous content
		// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
		try {
			active.id;
		} catch( e ) {
			active = document.body;
		}

		element.wrap( wrapper );

		// Fixes #7595 - Elements lose focus when wrapped.
		if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
			$( active ).focus();
		}

		wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element

		// transfer positioning properties to the wrapper
		if ( element.css( "position" ) === "static" ) {
			wrapper.css({ position: "relative" });
			element.css({ position: "relative" });
		} else {
			$.extend( props, {
				position: element.css( "position" ),
				zIndex: element.css( "z-index" )
			});
			$.each([ "top", "left", "bottom", "right" ], function(i, pos) {
				props[ pos ] = element.css( pos );
				if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
					props[ pos ] = "auto";
				}
			});
			element.css({
				position: "relative",
				top: 0,
				left: 0,
				right: "auto",
				bottom: "auto"
			});
		}
		element.css(size);

		return wrapper.css( props ).show();
	}
function ( element ) { // if the element is already wrapped, return it if ( element . parent ( ) . is ( ".ui-effects-wrapper" ) ) { return element . parent ( ) ; } // wrap the element var props = { width : element . outerWidth ( true ) , height : element . outerHeight ( true ) , "float" : element . css ( "float" ) } , wrapper = $ ( "<div></div>" ) . addClass ( "ui-effects-wrapper" ) . css ( { fontSize : "100%" , background : "transparent" , border : "none" , margin : 0 , padding : 0 } ) , // Store the size in case width/height are defined in % - Fixes #5245 size = { width : element . width ( ) , height : element . height ( ) } , active = document . activeElement ; // support: Firefox // Firefox incorrectly exposes anonymous content // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 try { active . id ; } catch ( e ) { active = document . body ; } element . wrap ( wrapper ) ; // Fixes #7595 - Elements lose focus when wrapped. if ( element [ 0 ] === active || $ . contains ( element [ 0 ] , active ) ) { $ ( active ) . focus ( ) ; } wrapper = element . parent ( ) ; //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element // transfer positioning properties to the wrapper if ( element . css ( "position" ) === "static" ) { wrapper . css ( { position : "relative" } ) ; element . css ( { position : "relative" } ) ; } else { $ . extend ( props , { position : element . css ( "position" ) , zIndex : element . css ( "z-index" ) } ) ; $ . each ( [ "top" , "left" , "bottom" , "right" ] , function ( i , pos ) { props [ pos ] = element . css ( pos ) ; if ( isNaN ( parseInt ( props [ pos ] , 10 ) ) ) { props [ pos ] = "auto" ; } } ) ; element . css ( { position : "relative" , top : 0 , left : 0 , right : "auto" , bottom : "auto" } ) ; } element . css ( size ) ; return wrapper . css ( props ) . show ( ) ; }
Wraps the element around a wrapper that copies position properties
Wraps the element around a wrapper that copies position properties