kromm77 icon

Confirm with Notify.Js

kromm77 | PRO | 04/23/18 07:19:25 AM UTC | 0 ⭐ | 511 👁️ | Never ⏰ | []
JavaScript |

1.3 KB

|

None

|

0 👍

/

0 👎

 $.notify.addStyle('confirm', {
                    html:
                        "<div>" +
                        "<div class='confirm_base'>" +
                        "<div class='circuitid' data-notify-text='circuitid' />" +
                        "<div class='title' data-notify-html='title'/>" +
                        "<div class='buttons'>" +
                        "<button class='no'>Cancel</button>" +
                        "<button class='yes' data-notify-text='button'></button>" +
                        "</div>" +
                        "</div>" +
                        "</div>",
                    classes: {
                        base: {
                            "background-color": "#b6ff00"
                        }
                    }
                });
 
 
$(document).on('click', '.notifyjs-confirm-base .no', function () {
 //programmatically trigger propogating hide event
 $(this).trigger('notify-hide');
});
$(document).on('click', '.notifyjs-confirm-base .yes', function () {
    //show button text
    $(this).trigger('notify-hide');
    action(circuitid);
});
$.notify({
    title: msg,
    button: "Confermo",
    circuitid: circuitid,
}, {
        className: "info",
        style: 'confirm',
        autoHide: false,
        clickToHide: true,
        globalPosition: "top center"
    }
);

Comments