Skip to content

Commit 868e8c7

Browse files
committed
Effects: Fix style issues in individual effects
Skipping ui/effect.js since embedded jquery-color has many issues. Closes jquerygh-1510
1 parent c16a5e5 commit 868e8c7

16 files changed

+118
-117
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ var
8383
"ui/datepicker.js",
8484
"ui/draggable.js",
8585
"ui/droppable.js",
86-
"ui/effect*.js",
86+
"ui/effect.js",
8787
"ui/mouse.js",
8888
"ui/resizable.js",
8989
"ui/selectable.js",

ui/effect-blind.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
//>>docs: http://api.jqueryui.com/blind-effect/
1414
//>>demos: http://jqueryui.com/effect/
1515

16-
(function( factory ) {
16+
( function( factory ) {
1717
if ( typeof define === "function" && define.amd ) {
1818

1919
// AMD. Register as an anonymous module.
20-
define([
20+
define( [
2121
"jquery",
2222
"./effect"
2323
], factory );
@@ -26,7 +26,7 @@
2626
// Browser globals
2727
factory( jQuery );
2828
}
29-
}(function( $ ) {
29+
}( function( $ ) {
3030

3131
return $.effects.define( "blind", "hide", function( options, done ) {
3232
var map = {
@@ -63,7 +63,7 @@ return $.effects.define( "blind", "hide", function( options, done ) {
6363
duration: options.duration,
6464
easing: options.easing,
6565
complete: done
66-
});
67-
});
66+
} );
67+
} );
6868

69-
}));
69+
} ) );

ui/effect-bounce.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
//>>docs: http://api.jqueryui.com/bounce-effect/
1414
//>>demos: http://jqueryui.com/effect/
1515

16-
(function( factory ) {
16+
( function( factory ) {
1717
if ( typeof define === "function" && define.amd ) {
1818

1919
// AMD. Register as an anonymous module.
20-
define([
20+
define( [
2121
"jquery",
2222
"./effect"
2323
], factory );
@@ -26,7 +26,7 @@
2626
// Browser globals
2727
factory( jQuery );
2828
}
29-
}(function( $ ) {
29+
}( function( $ ) {
3030

3131
return $.effects.define( "bounce", function( options, done ) {
3232
var upAnim, downAnim, refValue,
@@ -103,6 +103,6 @@ return $.effects.define( "bounce", function( options, done ) {
103103
element.queue( done );
104104

105105
$.effects.unshift( element, queuelen, anims + 1 );
106-
});
106+
} );
107107

108-
}));
108+
} ) );

ui/effect-clip.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
//>>docs: http://api.jqueryui.com/clip-effect/
1414
//>>demos: http://jqueryui.com/effect/
1515

16-
(function( factory ) {
16+
( function( factory ) {
1717
if ( typeof define === "function" && define.amd ) {
1818

1919
// AMD. Register as an anonymous module.
20-
define([
20+
define( [
2121
"jquery",
2222
"./effect"
2323
], factory );
@@ -26,7 +26,7 @@
2626
// Browser globals
2727
factory( jQuery );
2828
}
29-
}(function( $ ) {
29+
}( function( $ ) {
3030

3131
return $.effects.define( "clip", "hide", function( options, done ) {
3232
var start,
@@ -57,8 +57,8 @@ return $.effects.define( "clip", "hide", function( options, done ) {
5757
duration: options.duration,
5858
easing: options.easing,
5959
complete: done
60-
});
60+
} );
6161

62-
});
62+
} );
6363

64-
}));
64+
} ) );

ui/effect-drop.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
//>>docs: http://api.jqueryui.com/drop-effect/
1414
//>>demos: http://jqueryui.com/effect/
1515

16-
(function( factory ) {
16+
( function( factory ) {
1717
if ( typeof define === "function" && define.amd ) {
1818

1919
// AMD. Register as an anonymous module.
20-
define([
20+
define( [
2121
"jquery",
2222
"./effect"
2323
], factory );
@@ -26,7 +26,7 @@
2626
// Browser globals
2727
factory( jQuery );
2828
}
29-
}(function( $ ) {
29+
}( function( $ ) {
3030

3131
return $.effects.define( "drop", "hide", function( options, done ) {
3232

@@ -61,7 +61,7 @@ return $.effects.define( "drop", "hide", function( options, done ) {
6161
duration: options.duration,
6262
easing: options.easing,
6363
complete: done
64-
});
65-
});
64+
} );
65+
} );
6666

67-
}));
67+
} ) );

ui/effect-explode.js

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
//>>docs: http://api.jqueryui.com/explode-effect/
1414
//>>demos: http://jqueryui.com/effect/
1515

16-
(function( factory ) {
16+
( function( factory ) {
1717
if ( typeof define === "function" && define.amd ) {
1818

1919
// AMD. Register as an anonymous module.
20-
define([
20+
define( [
2121
"jquery",
2222
"./effect"
2323
], factory );
@@ -26,7 +26,7 @@
2626
// Browser globals
2727
factory( jQuery );
2828
}
29-
}(function( $ ) {
29+
}( function( $ ) {
3030

3131
return $.effects.define( "explode", "hide", function( options, done ) {
3232

@@ -54,54 +54,55 @@ return $.effects.define( "explode", "hide", function( options, done ) {
5454
}
5555

5656
// clone the element for each row and cell.
57-
for ( i = 0; i < rows ; i++ ) { // ===>
57+
for ( i = 0; i < rows; i++ ) { // ===>
5858
top = offset.top + i * height;
59-
my = i - ( rows - 1 ) / 2 ;
59+
my = i - ( rows - 1 ) / 2;
6060

61-
for ( j = 0; j < cells ; j++ ) { // |||
61+
for ( j = 0; j < cells; j++ ) { // |||
6262
left = offset.left + j * width;
63-
mx = j - ( cells - 1 ) / 2 ;
63+
mx = j - ( cells - 1 ) / 2;
6464

6565
// Create a clone of the now hidden main element that will be absolute positioned
6666
// within a wrapper div off the -left and -top equal to size of our pieces
6767
element
6868
.clone()
6969
.appendTo( "body" )
7070
.wrap( "<div></div>" )
71-
.css({
71+
.css( {
7272
position: "absolute",
7373
visibility: "visible",
7474
left: -j * width,
7575
top: -i * height
76-
})
76+
} )
7777

78-
// select the wrapper - make it overflow: hidden and absolute positioned based on
79-
// where the original was located +left and +top equal to the size of pieces
78+
// select the wrapper - make it overflow: hidden and absolute positioned based on
79+
// where the original was located +left and +top equal to the size of pieces
8080
.parent()
81-
.addClass( "ui-effects-explode" )
82-
.css({
83-
position: "absolute",
84-
overflow: "hidden",
85-
width: width,
86-
height: height,
87-
left: left + ( show ? mx * width : 0 ),
88-
top: top + ( show ? my * height : 0 ),
89-
opacity: show ? 0 : 1
90-
}).animate({
91-
left: left + ( show ? 0 : mx * width ),
92-
top: top + ( show ? 0 : my * height ),
93-
opacity: show ? 1 : 0
94-
}, options.duration || 500, options.easing, childComplete );
81+
.addClass( "ui-effects-explode" )
82+
.css( {
83+
position: "absolute",
84+
overflow: "hidden",
85+
width: width,
86+
height: height,
87+
left: left + ( show ? mx * width : 0 ),
88+
top: top + ( show ? my * height : 0 ),
89+
opacity: show ? 0 : 1
90+
} )
91+
.animate( {
92+
left: left + ( show ? 0 : mx * width ),
93+
top: top + ( show ? 0 : my * height ),
94+
opacity: show ? 1 : 0
95+
}, options.duration || 500, options.easing, childComplete );
9596
}
9697
}
9798

9899
function animComplete() {
99-
element.css({
100+
element.css( {
100101
visibility: "visible"
101-
});
102+
} );
102103
$( pieces ).remove();
103104
done();
104105
}
105-
});
106+
} );
106107

107-
}));
108+
} ) );

ui/effect-fade.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
//>>docs: http://api.jqueryui.com/fade-effect/
1414
//>>demos: http://jqueryui.com/effect/
1515

16-
(function( factory ) {
16+
( function( factory ) {
1717
if ( typeof define === "function" && define.amd ) {
1818

1919
// AMD. Register as an anonymous module.
20-
define([
20+
define( [
2121
"jquery",
2222
"./effect"
2323
], factory );
@@ -26,21 +26,21 @@
2626
// Browser globals
2727
factory( jQuery );
2828
}
29-
}(function( $ ) {
29+
}( function( $ ) {
3030

3131
return $.effects.define( "fade", "toggle", function( options, done ) {
3232
var show = options.mode === "show";
3333

3434
$( this )
3535
.css( "opacity", show ? 0 : 1 )
36-
.animate({
36+
.animate( {
3737
opacity: show ? 1 : 0
3838
}, {
3939
queue: false,
4040
duration: options.duration,
4141
easing: options.easing,
4242
complete: done
43-
});
44-
});
43+
} );
44+
} );
4545

46-
}));
46+
} ) );

ui/effect-fold.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
//>>docs: http://api.jqueryui.com/fold-effect/
1414
//>>demos: http://jqueryui.com/effect/
1515

16-
(function( factory ) {
16+
( function( factory ) {
1717
if ( typeof define === "function" && define.amd ) {
1818

1919
// AMD. Register as an anonymous module.
20-
define([
20+
define( [
2121
"jquery",
2222
"./effect"
2323
], factory );
@@ -26,7 +26,7 @@
2626
// Browser globals
2727
factory( jQuery );
2828
}
29-
}(function( $ ) {
29+
}( function( $ ) {
3030

3131
return $.effects.define( "fold", "hide", function( options, done ) {
3232

@@ -69,20 +69,20 @@ return $.effects.define( "fold", "hide", function( options, done ) {
6969

7070
// Animate
7171
element
72-
.queue(function( next ) {
72+
.queue( function( next ) {
7373
if ( placeholder ) {
7474
placeholder
7575
.animate( $.effects.clipToBox( animation1 ), duration, options.easing )
7676
.animate( $.effects.clipToBox( animation2 ), duration, options.easing );
7777
}
7878

7979
next();
80-
})
80+
} )
8181
.animate( animation1, duration, options.easing )
8282
.animate( animation2, duration, options.easing )
8383
.queue( done );
8484

8585
$.effects.unshift( element, queuelen, 4 );
86-
});
86+
} );
8787

88-
}));
88+
} ) );

ui/effect-highlight.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
//>>docs: http://api.jqueryui.com/highlight-effect/
1414
//>>demos: http://jqueryui.com/effect/
1515

16-
(function( factory ) {
16+
( function( factory ) {
1717
if ( typeof define === "function" && define.amd ) {
1818

1919
// AMD. Register as an anonymous module.
20-
define([
20+
define( [
2121
"jquery",
2222
"./effect"
2323
], factory );
@@ -26,7 +26,7 @@
2626
// Browser globals
2727
factory( jQuery );
2828
}
29-
}(function( $ ) {
29+
}( function( $ ) {
3030

3131
return $.effects.define( "highlight", "show", function( options, done ) {
3232
var element = $( this ),
@@ -41,16 +41,16 @@ return $.effects.define( "highlight", "show", function( options, done ) {
4141
$.effects.saveStyle( element );
4242

4343
element
44-
.css({
44+
.css( {
4545
backgroundImage: "none",
4646
backgroundColor: options.color || "#ffff99"
47-
})
47+
} )
4848
.animate( animation, {
4949
queue: false,
5050
duration: options.duration,
5151
easing: options.easing,
5252
complete: done
53-
});
54-
});
53+
} );
54+
} );
5555

56-
}));
56+
} ) );

0 commit comments

Comments
 (0)