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