kamranahmedse / jquery-toast-plugin

Highly customizable jquery plugin to show toast messages
http://kamranahmed.info/toast
1.51k stars 507 forks source link

options.hideAfter not respected when calling update #14

Open ghost opened 8 years ago

ghost commented 8 years ago

If, when creating the toast, hideAfter is set to false and a subsequent call to update specifies a non-false value for hideAfter, the toast will not automatically close after the specified amount.

For example:

var toast = $.toast({
            text: 'doing something',            
            position: 'top-center',
            allowToastClose: false,
            hideAfter: false
});

// do someothing that takes some time

toast.update({
           text: 'done',
           hideAfter: 2000
});

My use case is for saving data. I initially show a "Saving..." message when the save starts, and then I update the message "Save successful" when it completes. The original message should stay up until the latter changes it, however the latter should disappear after a bit.

Martin-Nyaga commented 8 years ago

See pull request #12 which fixes this behaviour.