[Kimchi-devel] [PATCH] [Wok] Issue #10: wok.message with closeable as true is also fading out after timeout

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Thu Dec 17 11:10:15 UTC 2015


Reviewed-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>

On 12/17/2015 03:56 AM, archus at linux.vnet.ibm.com wrote:
> From: Archana Singh <archus at linux.vnet.ibm.com>
>
> Added check if closeable is true, then don't
> setTimeout to fadeOut the message.
>
> Signed-off-by: Archana Singh <archus at linux.vnet.ibm.com>
> ---
>   ui/js/src/wok.message.js | 20 +++++++++++---------
>   1 file changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/ui/js/src/wok.message.js b/ui/js/src/wok.message.js
> index 5f5759e..63bf84e 100644
> --- a/ui/js/src/wok.message.js
> +++ b/ui/js/src/wok.message.js
> @@ -36,15 +36,17 @@ wok.message = function(msg, level, node, closeable) {
>       $message.alert();
>       $message.fadeIn(100);
>
> -    var timeout = setTimeout(function() {
> -        $message.delay(4000).fadeOut(100, function() {
> -            $message.alert('close');
> -            $(this).remove();
> -            if ($(container).children().length < 1) {
> -                $(container).hide();
> -            }
> -        });
> -    }, 10000);
> +    if(!closeable){
> +        var timeout = setTimeout(function() {
> +            $message.delay(4000).fadeOut(100, function() {
> +                $message.alert('close');
> +                $(this).remove();
> +                if ($(container).children().length < 1) {
> +                    $(container).hide();
> +                }
> +            });
> +        }, 10000);
> +    }
>   };
>
>   wok.message.warn = function(msg, node, closeable) {




More information about the Kimchi-devel mailing list