]> source.dussan.org Git - jquery-ui.git/commitdiff
Effects: Fix style issues in individual effects
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 18 Mar 2015 14:39:12 +0000 (15:39 +0100)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 18 Mar 2015 14:42:55 +0000 (15:42 +0100)
Skipping ui/effect.js since embedded jquery-color has many issues.

Closes gh-1510

16 files changed:
Gruntfile.js
ui/effect-blind.js
ui/effect-bounce.js
ui/effect-clip.js
ui/effect-drop.js
ui/effect-explode.js
ui/effect-fade.js
ui/effect-fold.js
ui/effect-highlight.js
ui/effect-puff.js
ui/effect-pulsate.js
ui/effect-scale.js
ui/effect-shake.js
ui/effect-size.js
ui/effect-slide.js
ui/effect-transfer.js

index 5cc640b737f08d1e25998d7f059d0be4034c97b1..f69aed06a67c14fd16c1989bc5bce177107e69a2 100644 (file)
@@ -83,7 +83,7 @@ var
                "ui/datepicker.js",
                "ui/draggable.js",
                "ui/droppable.js",
-               "ui/effect*.js",
+               "ui/effect.js",
                "ui/mouse.js",
                "ui/resizable.js",
                "ui/selectable.js",
index 291c309e58bfd04772c771459a156a34f520d299..45358d7594f57bacebea1465fbb1e53d7a139c7d 100644 (file)
 //>>docs: http://api.jqueryui.com/blind-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect"
                ], factory );
@@ -26,7 +26,7 @@
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 return $.effects.define( "blind", "hide", function( options, done ) {
        var map = {
@@ -63,7 +63,7 @@ return $.effects.define( "blind", "hide", function( options, done ) {
                duration: options.duration,
                easing: options.easing,
                complete: done
-       });
-});
+       } );
+} );
 
-}));
+} ) );
index 197acda5ed21c427fe0de73649ad54aa06d631ee..8a5d58e3010349605871dde30088c75b19d591d1 100644 (file)
 //>>docs: http://api.jqueryui.com/bounce-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect"
                ], factory );
@@ -26,7 +26,7 @@
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 return $.effects.define( "bounce", function( options, done ) {
        var upAnim, downAnim, refValue,
@@ -103,6 +103,6 @@ return $.effects.define( "bounce", function( options, done ) {
        element.queue( done );
 
        $.effects.unshift( element, queuelen, anims + 1 );
-});
+} );
 
-}));
+} ) );
index 534df60287b1067bd1b4d702283ccb0f4b976678..4eb24eb88e710d8f4bbdc88ee93303db7dcd44da 100644 (file)
 //>>docs: http://api.jqueryui.com/clip-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect"
                ], factory );
@@ -26,7 +26,7 @@
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 return $.effects.define( "clip", "hide", function( options, done ) {
        var start,
@@ -57,8 +57,8 @@ return $.effects.define( "clip", "hide", function( options, done ) {
                duration: options.duration,
                easing: options.easing,
                complete: done
-       });
+       } );
 
-});
+} );
 
-}));
+} ) );
index 2afad399b65bb08c9a7f4700ad722825384495a8..3ad90caa6fe486d3ee47e4869bec7be9b509fc9f 100644 (file)
 //>>docs: http://api.jqueryui.com/drop-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect"
                ], factory );
@@ -26,7 +26,7 @@
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 return $.effects.define( "drop", "hide", function( options, done ) {
 
@@ -61,7 +61,7 @@ return $.effects.define( "drop", "hide", function( options, done ) {
                duration: options.duration,
                easing: options.easing,
                complete: done
-       });
-});
+       } );
+} );
 
-}));
+} ) );
index c1145b0b3c5079c34692d1e7e0919c7ee8bf5d42..3e468675afae622da31ccb7c97c96afbbd582c4c 100644 (file)
 //>>docs: http://api.jqueryui.com/explode-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect"
                ], factory );
@@ -26,7 +26,7 @@
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 return $.effects.define( "explode", "hide", function( options, done ) {
 
@@ -54,13 +54,13 @@ return $.effects.define( "explode", "hide", function( options, done ) {
        }
 
        // clone the element for each row and cell.
-       for ( i = 0; i < rows ; i++ ) { // ===>
+       for ( i = 0; i < rows; i++ ) { // ===>
                top = offset.top + i * height;
-               my = i - ( rows - 1 ) / 2 ;
+               my = i - ( rows - 1 ) / 2;
 
-               for ( j = 0; j < cells ; j++ ) { // |||
+               for ( j = 0; j < cells; j++ ) { // |||
                        left = offset.left + j * width;
-                       mx = j - ( cells - 1 ) / 2 ;
+                       mx = j - ( cells - 1 ) / 2;
 
                        // Create a clone of the now hidden main element that will be absolute positioned
                        // within a wrapper div off the -left and -top equal to size of our pieces
@@ -68,40 +68,41 @@ return $.effects.define( "explode", "hide", function( options, done ) {
                                .clone()
                                .appendTo( "body" )
                                .wrap( "<div></div>" )
-                               .css({
+                               .css( {
                                        position: "absolute",
                                        visibility: "visible",
                                        left: -j * width,
                                        top: -i * height
-                               })
+                               } )
 
-                       // select the wrapper - make it overflow: hidden and absolute positioned based on
-                       // where the original was located +left and +top equal to the size of pieces
+                               // select the wrapper - make it overflow: hidden and absolute positioned based on
+                               // where the original was located +left and +top equal to the size of pieces
                                .parent()
-                               .addClass( "ui-effects-explode" )
-                               .css({
-                                       position: "absolute",
-                                       overflow: "hidden",
-                                       width: width,
-                                       height: height,
-                                       left: left + ( show ? mx * width : 0 ),
-                                       top: top + ( show ? my * height : 0 ),
-                                       opacity: show ? 0 : 1
-                               }).animate({
-                                       left: left + ( show ? 0 : mx * width ),
-                                       top: top + ( show ? 0 : my * height ),
-                                       opacity: show ? 1 : 0
-                               }, options.duration || 500, options.easing, childComplete );
+                                       .addClass( "ui-effects-explode" )
+                                       .css( {
+                                               position: "absolute",
+                                               overflow: "hidden",
+                                               width: width,
+                                               height: height,
+                                               left: left + ( show ? mx * width : 0 ),
+                                               top: top + ( show ? my * height : 0 ),
+                                               opacity: show ? 0 : 1
+                                       } )
+                                       .animate( {
+                                               left: left + ( show ? 0 : mx * width ),
+                                               top: top + ( show ? 0 : my * height ),
+                                               opacity: show ? 1 : 0
+                                       }, options.duration || 500, options.easing, childComplete );
                }
        }
 
        function animComplete() {
-               element.css({
+               element.css( {
                        visibility: "visible"
-               });
+               } );
                $( pieces ).remove();
                done();
        }
-});
+} );
 
-}));
+} ) );
index aba0ad482fa81923b4eda3a0aa4a06932a5267ab..ecc44722a1ee45cc82abc8c6fef1f67479935cd7 100644 (file)
 //>>docs: http://api.jqueryui.com/fade-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect"
                ], factory );
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 return $.effects.define( "fade", "toggle", function( options, done ) {
        var show = options.mode === "show";
 
        $( this )
                .css( "opacity", show ? 0 : 1 )
-               .animate({
+               .animate( {
                        opacity: show ? 1 : 0
                }, {
                        queue: false,
                        duration: options.duration,
                        easing: options.easing,
                        complete: done
-               });
-});
+               } );
+} );
 
-}));
+} ) );
index 3af1dd6027bde0b390241c8c9e42cac3c722ae03..a61eef0abb64061006254a842b4a23030a03d5c7 100644 (file)
 //>>docs: http://api.jqueryui.com/fold-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect"
                ], factory );
@@ -26,7 +26,7 @@
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 return $.effects.define( "fold", "hide", function( options, done ) {
 
@@ -69,7 +69,7 @@ return $.effects.define( "fold", "hide", function( options, done ) {
 
        // Animate
        element
-               .queue(function( next ) {
+               .queue( function( next ) {
                        if ( placeholder ) {
                                placeholder
                                        .animate( $.effects.clipToBox( animation1 ), duration, options.easing )
@@ -77,12 +77,12 @@ return $.effects.define( "fold", "hide", function( options, done ) {
                        }
 
                        next();
-               })
+               } )
                .animate( animation1, duration, options.easing )
                .animate( animation2, duration, options.easing )
                .queue( done );
 
        $.effects.unshift( element, queuelen, 4 );
-});
+} );
 
-}));
+} ) );
index da3f82b72a8dcf9ffcb7bbbb8983eff4abac2706..721a3a05b2b1cd98e94a61f453bb89487675f84a 100644 (file)
 //>>docs: http://api.jqueryui.com/highlight-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect"
                ], factory );
@@ -26,7 +26,7 @@
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 return $.effects.define( "highlight", "show", function( options, done ) {
        var element = $( this ),
@@ -41,16 +41,16 @@ return $.effects.define( "highlight", "show", function( options, done ) {
        $.effects.saveStyle( element );
 
        element
-               .css({
+               .css( {
                        backgroundImage: "none",
                        backgroundColor: options.color || "#ffff99"
-               })
+               } )
                .animate( animation, {
                        queue: false,
                        duration: options.duration,
                        easing: options.easing,
                        complete: done
-               });
-});
+               } );
+} );
 
-}));
+} ) );
index a90174c2588708f21f4fa1df0563f0c37c87a632..ac3f90a64d242f315beac5df9bfd041c7cb53bee 100644 (file)
 //>>docs: http://api.jqueryui.com/puff-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect",
                        "./effect-scale"
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 return $.effects.define( "puff", "hide", function( options, done ) {
        var newOptions = $.extend( true, {}, options, {
                fade: true,
                percent: parseInt( options.percent, 10 ) || 150
-       });
+       } );
 
        $.effects.effect.scale.call( this, newOptions, done );
-});
+} );
 
-}));
+} ) );
index 95cf811a63bc784fe8b8234513e313ad41f2efad..f6f46da766b075d67803cd924a053aa60ff01edd 100644 (file)
 //>>docs: http://api.jqueryui.com/pulsate-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect"
                ], factory );
@@ -26,7 +26,7 @@
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 return $.effects.define( "pulsate", "show", function( options, done ) {
        var element = $( this ),
@@ -58,6 +58,6 @@ return $.effects.define( "pulsate", "show", function( options, done ) {
        element.queue( done );
 
        $.effects.unshift( element, queuelen, anims + 1 );
-});
+} );
 
-}));
+} ) );
index 18e6960c1d6897645bae5abcbb077fe3b81b3d20..5d76ac166afab1ecba1425f219f5c4154e031568 100644 (file)
 //>>docs: http://api.jqueryui.com/scale-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect",
                        "./effect-size"
@@ -27,7 +27,7 @@
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 return $.effects.define( "scale", function( options, done ) {
 
@@ -50,6 +50,6 @@ return $.effects.define( "scale", function( options, done ) {
        }
 
        $.effects.effect.size.call( this, newOptions, done );
-});
+} );
 
-}));
+} ) );
index a94503f29ce133e57ced1d4561cfc133f38fad1c..52240fed0a785c2db21e6f24117f6af0d12b9a90 100644 (file)
 //>>docs: http://api.jqueryui.com/shake-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect"
                ], factory );
@@ -26,7 +26,7 @@
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 return $.effects.define( "shake", function( options, done ) {
 
@@ -66,6 +66,6 @@ return $.effects.define( "shake", function( options, done ) {
                .queue( done );
 
        $.effects.unshift( element, queuelen, anims + 1 );
-});
+} );
 
-}));
+} ) );
index 3be3984b63bf06117873fbb137c1ea641b799750..16a2adac1b9cc79c9e23be485d2652b5585f30b7 100644 (file)
 //>>docs: http://api.jqueryui.com/size-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect"
                ], factory );
@@ -26,7 +26,7 @@
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 return $.effects.define( "size", function( options, done ) {
 
@@ -109,8 +109,8 @@ return $.effects.define( "size", function( options, done ) {
        // Animate the children if desired
        if ( scale === "content" || scale === "both" ) {
 
-               vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat( cProps );
-               hProps = hProps.concat([ "marginLeft", "marginRight" ]);
+               vProps = vProps.concat( [ "marginTop", "marginBottom" ] ).concat( cProps );
+               hProps = hProps.concat( [ "marginLeft", "marginRight" ] );
 
                // Only animate children with width attributes specified
                // TODO: is this right? should we include anything with css width specified as well
@@ -154,8 +154,8 @@ return $.effects.define( "size", function( options, done ) {
                                if ( restore ) {
                                        $.effects.restoreStyle( child );
                                }
-                       });
-               });
+                       } );
+               } );
        }
 
        // Animate
@@ -183,8 +183,8 @@ return $.effects.define( "size", function( options, done ) {
 
                        done();
                }
-       });
+       } );
 
-});
+} );
 
-}));
+} ) );
index b6626cbb844d8293337cbb7080c9a6fbbda34904..1f401305848b1f0089522400756b9945239dda08 100644 (file)
 //>>docs: http://api.jqueryui.com/slide-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect"
                ], factory );
@@ -26,7 +26,7 @@
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 return $.effects.define( "slide", "show", function( options, done ) {
        var startClip, startRef,
@@ -68,7 +68,7 @@ return $.effects.define( "slide", "show", function( options, done ) {
                duration: options.duration,
                easing: options.easing,
                complete: done
-       });
-});
+       } );
+} );
 
-}));
+} ) );
index b0bc428866fa5604a6e55d3b7bc7b8b790770bdf..41208b9e688042d03716f2b38b36f90a47775bb4 100644 (file)
 //>>docs: http://api.jqueryui.com/transfer-effect/
 //>>demos: http://jqueryui.com/effect/
 
-(function( factory ) {
+( function( factory ) {
        if ( typeof define === "function" && define.amd ) {
 
                // AMD. Register as an anonymous module.
-               define([
+               define( [
                        "jquery",
                        "./effect"
                ], factory );
                // Browser globals
                factory( jQuery );
        }
-}(function( $ ) {
+}( function( $ ) {
 
 if ( $.uiBackCompat !== false ) {
        return $.effects.define( "transfer", function( options, done ) {
                $( this ).transfer( options, done );
-       });
+       } );
 }
 
-}));
+} ) );