function $addRemoveButton1 ($panel1) {
    // create remove button
    var $removeButton1 = $('<a href="#" class="btn btn-danger">Supprimer</a>');
    // appending the removebutton to the panel footer
    var $panel1Footer = $('<div class="panel-footer"></div>').append($removeButton1);
    // handle the click event of the remove button
    $removeButton1.click(function (e) {
        e.preventDefault();
        // gets the parent of the button that we clicked on "the panel" and animates it
        // after the animation is done the element (the panel) is removed from the html
        $(e.target).parents('.panel').slideUp(1000, function () {
            $(this).remove();
        })
    });
    // append the footer to the panel
    $panel1.append($panel1Footer);
}
/**
 * adds a remove button to the panel that is passed in the parameter
 * @param $panel1
 */
adds a remove button to the panel that is passed in the parameter
@param $panel1
adds a remove button to the panel that is passed in the parameter @param $panel1
function $addRemoveButton1 ($panel1) {
    var $removeButton1 = $('<a href="#" class="btn btn-danger">Supprimer</a>');
    var $panel1Footer = $('<div class="panel-footer"></div>').append($removeButton1);
    $removeButton1.click(function (e) {
        e.preventDefault();
        $(e.target).parents('.panel').slideUp(1000, function () {
            $(this).remove();
        })
    });
    $panel1.append($panel1Footer);
}
function $addRemoveButton1 ( $panel1 ) { var $removeButton1 = $ ( '<a href="#" class="btn btn-danger">Supprimer</a>' ) ; var $panel1Footer = $ ( '<div class="panel-footer"></div>' ) . append ( $removeButton1 ) ; $removeButton1 . click ( function ( e ) { e . preventDefault ( ) ; $ ( e . target ) . parents ( '.panel' ) . slideUp ( 1000 , function ( ) { $ ( this ) . remove ( ) ; } ) } ) ; $panel1 . append ( $panel1Footer ) ; }
adds a remove button to the panel that is passed in the parameter
 @param $panel1
adds a remove button to the panel that is passed in the parameter @param $panel1
// create remove button // appending the removebutton to the panel footer // handle the click event of the remove button // gets the parent of the button that we clicked on "the panel" and animates it // after the animation is done the element (the panel) is removed from the html // append the footer to the panel