bootstrap-notify icon indicating copy to clipboard operation
bootstrap-notify copied to clipboard

Feature request: Make 'allow_dismiss' .update()-able

Open defkev opened this issue 10 years ago • 3 comments

I have the requirement to make a notification sticky/persistent whenever its (quite lengthy) underlying operation failed, but using allow_dismiss = true in the $.notify constructor is not an option as i don't wont the user to be able to close the notification will the operation is still running, so being able too change allow_dismiss on the fly would be quite handy.

Can be realized with only 3 additional lines of code:

case "allow_dismiss":
    this.$ele.find('[data-notify="dismiss"]').css('display', commands[command] == true ? 'inline' : 'none');
    break;

Use like any other .update() e.g.

myNotify.notify({},{
    allow_dismiss: false,
    showProgressbar: true
}
...
if(e.status 429) {
   // Something went foo
   // make notification sticky
   myNotify.update('allow_dismiss': true)
}
else {
    // all good, dismiss the notification
   myNotify.close()
}
...

defkev avatar Jun 18 '15 20:06 defkev

I'll look into this. I will have to see how to best handle this.

mouse0270 avatar Jun 18 '15 20:06 mouse0270

+1

FrisoKluit avatar Jul 10 '15 08:07 FrisoKluit

I working on an update I hope to release soon. This is already included. I am not currently sure when I am going to release it. I am hoping by the end of the month.

mouse0270 avatar Jul 10 '15 11:07 mouse0270