vendredi 30 avril 2021

Replace browser confirm() with other library like bootbox

Browser native confirm dialog doesn't look good.
I have ember route wherein taking user confirmation to proceed if there are any unsaved changes. I wanted to change the dialog with bootbox confirm dialog but that doesn't stop the execution as bootbox.confirm() method is async.

        willTransition: function(transition){
            // model dirty checking logic to set flag value
            if(flag){
                if(!confirm("Do you want to leave this page without save?")){
                    transition.abort();
                }
            }
          }

Note: ES6 is not used in project




Aucun commentaire:

Enregistrer un commentaire