UPDATE 4.4.0.0
[phpmyadmin.git] / js / jquery / src / jquery-ui / effect-highlight.js
blobcdf60fa65f4896053ce5296278723f8778a0dfd5
1 /*!
2  * jQuery UI Effects Highlight 1.11.2
3  * http://jqueryui.com
4  *
5  * Copyright 2014 jQuery Foundation and other contributors
6  * Released under the MIT license.
7  * http://jquery.org/license
8  *
9  * http://api.jqueryui.com/highlight-effect/
10  */
11 (function( factory ) {
12         if ( typeof define === "function" && define.amd ) {
14                 // AMD. Register as an anonymous module.
15                 define([
16                         "jquery",
17                         "./effect"
18                 ], factory );
19         } else {
21                 // Browser globals
22                 factory( jQuery );
23         }
24 }(function( $ ) {
26 return $.effects.effect.highlight = function( o, done ) {
27         var elem = $( this ),
28                 props = [ "backgroundImage", "backgroundColor", "opacity" ],
29                 mode = $.effects.setMode( elem, o.mode || "show" ),
30                 animation = {
31                         backgroundColor: elem.css( "backgroundColor" )
32                 };
34         if (mode === "hide") {
35                 animation.opacity = 0;
36         }
38         $.effects.save( elem, props );
40         elem
41                 .show()
42                 .css({
43                         backgroundImage: "none",
44                         backgroundColor: o.color || "#ffff99"
45                 })
46                 .animate( animation, {
47                         queue: false,
48                         duration: o.duration,
49                         easing: o.easing,
50                         complete: function() {
51                                 if ( mode === "hide" ) {
52                                         elem.hide();
53                                 }
54                                 $.effects.restore( elem, props );
55                                 done();
56                         }
57                 });
60 }));