define(['jquery', 'bootbox'], function($, bootbox) {
    /*
     * Managing the bootbox popup on a .confirm link.
     *
     * Expected HTML structure to make this script work
     * <a href='' class='confirm' data-message=''></a>
     */
    var init = function (l, callback) {
        var locale = l || 'fr';
        bootbox.setDefaults({
            locale: locale
        });

        $(document).on("click", ".confirm", function(event) {
            event.preventDefault();
            var self = this;
            bootbox.confirm($(this).data('message'), function(result) {
                if (result) {
                    if (typeof callback === "function") {
                        callback();
                    } else {
                        window.location = self.href;
                    }
                }
            });
        });
    };

    return init;
});

@@ -578,42 +578,8 @@
 ) %7B%0A
-                if (result) %7B%0A    
     
@@ -648,20 +648,16 @@
         
-    
 callback
@@ -657,23 +657,25 @@
 allback(
-);%0A    
+result);%0A
         
@@ -689,22 +689,30 @@
  %7D else 
-%7B%0A    
+if (result) %7B%0A
         
@@ -756,30 +756,8 @@
 ef;%0A
-                    %7D%0A
     

improve confirm script behavior