Edit File by line
/home/barbar84/public_h.../wp-inclu.../js/jquery/ui
File: effect-explode.js
/*!
[0] Fix | Delete
* jQuery UI Effects Explode 1.12.1
[1] Fix | Delete
* http://jqueryui.com
[2] Fix | Delete
*
[3] Fix | Delete
* Copyright jQuery Foundation and other contributors
[4] Fix | Delete
* Released under the MIT license.
[5] Fix | Delete
* http://jquery.org/license
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
//>>label: Explode Effect
[9] Fix | Delete
//>>group: Effects
[10] Fix | Delete
// jscs:disable maximumLineLength
[11] Fix | Delete
//>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness.
[12] Fix | Delete
// jscs:enable maximumLineLength
[13] Fix | Delete
//>>docs: http://api.jqueryui.com/explode-effect/
[14] Fix | Delete
//>>demos: http://jqueryui.com/effect/
[15] Fix | Delete
[16] Fix | Delete
( function( factory ) {
[17] Fix | Delete
if ( typeof define === "function" && define.amd ) {
[18] Fix | Delete
[19] Fix | Delete
// AMD. Register as an anonymous module.
[20] Fix | Delete
define( [
[21] Fix | Delete
"jquery",
[22] Fix | Delete
"./effect"
[23] Fix | Delete
], factory );
[24] Fix | Delete
} else {
[25] Fix | Delete
[26] Fix | Delete
// Browser globals
[27] Fix | Delete
factory( jQuery );
[28] Fix | Delete
}
[29] Fix | Delete
}( function( $ ) {
[30] Fix | Delete
[31] Fix | Delete
return $.effects.define( "explode", "hide", function( options, done ) {
[32] Fix | Delete
[33] Fix | Delete
var i, j, left, top, mx, my,
[34] Fix | Delete
rows = options.pieces ? Math.round( Math.sqrt( options.pieces ) ) : 3,
[35] Fix | Delete
cells = rows,
[36] Fix | Delete
element = $( this ),
[37] Fix | Delete
mode = options.mode,
[38] Fix | Delete
show = mode === "show",
[39] Fix | Delete
[40] Fix | Delete
// Show and then visibility:hidden the element before calculating offset
[41] Fix | Delete
offset = element.show().css( "visibility", "hidden" ).offset(),
[42] Fix | Delete
[43] Fix | Delete
// Width and height of a piece
[44] Fix | Delete
width = Math.ceil( element.outerWidth() / cells ),
[45] Fix | Delete
height = Math.ceil( element.outerHeight() / rows ),
[46] Fix | Delete
pieces = [];
[47] Fix | Delete
[48] Fix | Delete
// Children animate complete:
[49] Fix | Delete
function childComplete() {
[50] Fix | Delete
pieces.push( this );
[51] Fix | Delete
if ( pieces.length === rows * cells ) {
[52] Fix | Delete
animComplete();
[53] Fix | Delete
}
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
// Clone the element for each row and cell.
[57] Fix | Delete
for ( i = 0; i < rows; i++ ) { // ===>
[58] Fix | Delete
top = offset.top + i * height;
[59] Fix | Delete
my = i - ( rows - 1 ) / 2;
[60] Fix | Delete
[61] Fix | Delete
for ( j = 0; j < cells; j++ ) { // |||
[62] Fix | Delete
left = offset.left + j * width;
[63] Fix | Delete
mx = j - ( cells - 1 ) / 2;
[64] Fix | Delete
[65] Fix | Delete
// Create a clone of the now hidden main element that will be absolute positioned
[66] Fix | Delete
// within a wrapper div off the -left and -top equal to size of our pieces
[67] Fix | Delete
element
[68] Fix | Delete
.clone()
[69] Fix | Delete
.appendTo( "body" )
[70] Fix | Delete
.wrap( "<div></div>" )
[71] Fix | Delete
.css( {
[72] Fix | Delete
position: "absolute",
[73] Fix | Delete
visibility: "visible",
[74] Fix | Delete
left: -j * width,
[75] Fix | Delete
top: -i * height
[76] Fix | Delete
} )
[77] Fix | Delete
[78] Fix | Delete
// Select the wrapper - make it overflow: hidden and absolute positioned based on
[79] Fix | Delete
// where the original was located +left and +top equal to the size of pieces
[80] Fix | Delete
.parent()
[81] Fix | Delete
.addClass( "ui-effects-explode" )
[82] Fix | Delete
.css( {
[83] Fix | Delete
position: "absolute",
[84] Fix | Delete
overflow: "hidden",
[85] Fix | Delete
width: width,
[86] Fix | Delete
height: height,
[87] Fix | Delete
left: left + ( show ? mx * width : 0 ),
[88] Fix | Delete
top: top + ( show ? my * height : 0 ),
[89] Fix | Delete
opacity: show ? 0 : 1
[90] Fix | Delete
} )
[91] Fix | Delete
.animate( {
[92] Fix | Delete
left: left + ( show ? 0 : mx * width ),
[93] Fix | Delete
top: top + ( show ? 0 : my * height ),
[94] Fix | Delete
opacity: show ? 1 : 0
[95] Fix | Delete
}, options.duration || 500, options.easing, childComplete );
[96] Fix | Delete
}
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
function animComplete() {
[100] Fix | Delete
element.css( {
[101] Fix | Delete
visibility: "visible"
[102] Fix | Delete
} );
[103] Fix | Delete
$( pieces ).remove();
[104] Fix | Delete
done();
[105] Fix | Delete
}
[106] Fix | Delete
} );
[107] Fix | Delete
[108] Fix | Delete
} ) );
[109] Fix | Delete
[110] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function