Skip to content

Commit bec22f7

Browse files
committed
Core: Style fixes powered by esformatter
Closes jquery-archivegh-8080
1 parent c0bad29 commit bec22f7

File tree

12 files changed

+310
-310
lines changed

12 files changed

+310
-310
lines changed

js/animationComplete.js

Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -21,111 +21,111 @@
2121
// Browser globals
2222
factory( jQuery );
2323
}
24-
})( function( $ ) {
24+
} )( function( $ ) {
2525

26-
var props = {
27-
"animation": {},
28-
"transition": {}
29-
},
30-
testElement = document.createElement( "a" ),
31-
vendorPrefixes = [ "", "webkit-", "moz-", "o-" ];
26+
var props = {
27+
"animation": {},
28+
"transition": {}
29+
},
30+
testElement = document.createElement( "a" ),
31+
vendorPrefixes = [ "", "webkit-", "moz-", "o-" ];
3232

33-
$.each( [ "animation", "transition" ], function( i, test ) {
33+
$.each( [ "animation", "transition" ], function( i, test ) {
3434

35-
// Get correct name for test
36-
var testName = ( i === 0 ) ? test + "-" + "name" : test;
35+
// Get correct name for test
36+
var testName = ( i === 0 ) ? test + "-" + "name" : test;
3737

38-
$.each( vendorPrefixes, function( j, prefix ) {
39-
if ( testElement.style[ $.camelCase( prefix + testName ) ] !== undefined ) {
40-
props[ test ][ "prefix" ] = prefix;
41-
return false;
42-
}
43-
});
38+
$.each( vendorPrefixes, function( j, prefix ) {
39+
if ( testElement.style[ $.camelCase( prefix + testName ) ] !== undefined ) {
40+
props[ test ][ "prefix" ] = prefix;
41+
return false;
42+
}
43+
} );
4444

45-
// Set event and duration names for later use
46-
props[ test ][ "duration" ] =
47-
$.camelCase( props[ test ][ "prefix" ] + test + "-" + "duration" );
48-
props[ test ][ "event" ] =
49-
$.camelCase( props[ test ][ "prefix" ] + test + "-" + "end" );
45+
// Set event and duration names for later use
46+
props[ test ][ "duration" ] =
47+
$.camelCase( props[ test ][ "prefix" ] + test + "-" + "duration" );
48+
props[ test ][ "event" ] =
49+
$.camelCase( props[ test ][ "prefix" ] + test + "-" + "end" );
5050

51-
// All lower case if not a vendor prop
52-
if ( props[ test ][ "prefix" ] === "" ) {
53-
props[ test ][ "event" ] = props[ test ][ "event" ].toLowerCase();
54-
}
55-
});
51+
// All lower case if not a vendor prop
52+
if ( props[ test ][ "prefix" ] === "" ) {
53+
props[ test ][ "event" ] = props[ test ][ "event" ].toLowerCase();
54+
}
55+
} );
5656

57-
// If a valid prefix was found then the it is supported by the browser
58-
$.support.cssTransitions = ( props[ "transition" ][ "prefix" ] !== undefined );
59-
$.support.cssAnimations = ( props[ "animation" ][ "prefix" ] !== undefined );
57+
// If a valid prefix was found then the it is supported by the browser
58+
$.support.cssTransitions = ( props[ "transition" ][ "prefix" ] !== undefined );
59+
$.support.cssAnimations = ( props[ "animation" ][ "prefix" ] !== undefined );
6060

61-
// Remove the testElement
62-
$( testElement ).remove();
61+
// Remove the testElement
62+
$( testElement ).remove();
6363

64-
// Animation complete callback
65-
$.fn.animationComplete = function( callback, type, fallbackTime ) {
66-
var timer, duration,
67-
that = this,
68-
eventBinding = function() {
64+
// Animation complete callback
65+
$.fn.animationComplete = function( callback, type, fallbackTime ) {
66+
var timer, duration,
67+
that = this,
68+
eventBinding = function() {
6969

70-
// Clear the timer so we don't call callback twice
71-
clearTimeout( timer );
72-
callback.apply( this, arguments );
73-
},
74-
animationType = ( !type || type === "animation" ) ? "animation" : "transition";
70+
// Clear the timer so we don't call callback twice
71+
clearTimeout( timer );
72+
callback.apply( this, arguments );
73+
},
74+
animationType = ( !type || type === "animation" ) ? "animation" : "transition";
7575

76-
if ( !this.length ) {
77-
return this;
78-
}
76+
if ( !this.length ) {
77+
return this;
78+
}
7979

80-
// Make sure selected type is supported by browser
81-
if ( ( $.support.cssTransitions && animationType === "transition" ) ||
80+
// Make sure selected type is supported by browser
81+
if ( ( $.support.cssTransitions && animationType === "transition" ) ||
8282
( $.support.cssAnimations && animationType === "animation" ) ) {
8383

84-
// If a fallback time was not passed set one
85-
if ( fallbackTime === undefined ) {
84+
// If a fallback time was not passed set one
85+
if ( fallbackTime === undefined ) {
8686

87-
// Make sure the was not bound to document before checking .css
88-
if ( this.context !== document ) {
87+
// Make sure the was not bound to document before checking .css
88+
if ( this.context !== document ) {
8989

90-
// Parse the durration since its in second multiple by 1000 for milliseconds
91-
// Multiply by 3 to make sure we give the animation plenty of time.
92-
duration = parseFloat(
90+
// Parse the durration since its in second multiple by 1000 for milliseconds
91+
// Multiply by 3 to make sure we give the animation plenty of time.
92+
duration = parseFloat(
9393
this.css( props[ animationType ].duration )
9494
) * 3000;
95-
}
95+
}
9696

97-
// If we could not read a duration use the default
98-
if ( duration === 0 || duration === undefined || isNaN( duration ) ) {
99-
duration = $.fn.animationComplete.defaultDuration;
100-
}
97+
// If we could not read a duration use the default
98+
if ( duration === 0 || duration === undefined || isNaN( duration ) ) {
99+
duration = $.fn.animationComplete.defaultDuration;
101100
}
101+
}
102102

103-
// Sets up the fallback if event never comes
104-
timer = setTimeout( function() {
105-
that
106-
.off( props[ animationType ].event, eventBinding )
107-
.each( function() {
108-
callback.apply( this );
109-
});
110-
}, duration );
111-
112-
// Bind the event
113-
return this.one( props[ animationType ].event, eventBinding );
114-
} else {
115-
116-
// CSS animation / transitions not supported
117-
// Defer execution for consistency between webkit/non webkit
118-
setTimeout( function() {
119-
that.each( function() {
103+
// Sets up the fallback if event never comes
104+
timer = setTimeout( function() {
105+
that
106+
.off( props[ animationType ].event, eventBinding )
107+
.each( function() {
120108
callback.apply( this );
121-
});
122-
}, 0 );
123-
return this;
124-
}
125-
};
109+
} );
110+
}, duration );
111+
112+
// Bind the event
113+
return this.one( props[ animationType ].event, eventBinding );
114+
} else {
115+
116+
// CSS animation / transitions not supported
117+
// Defer execution for consistency between webkit/non webkit
118+
setTimeout( function() {
119+
that.each( function() {
120+
callback.apply( this );
121+
} );
122+
}, 0 );
123+
return this;
124+
}
125+
};
126126

127-
// Allow default callback to be configured on mobileInit
128-
$.fn.animationComplete.defaultDuration = 1000;
127+
// Allow default callback to be configured on mobileInit
128+
$.fn.animationComplete.defaultDuration = 1000;
129129

130-
return $.fn.animationComplete;
131-
});
130+
return $.fn.animationComplete;
131+
} );

0 commit comments

Comments
 (0)