Commit cf1dd3a9 authored by Romain Loth's avatar Romain Loth

(fix) project checkbox delete that i had broken (bug-49)

parent 0723ca24
...@@ -204,27 +204,24 @@ function getRessources(){ ...@@ -204,27 +204,24 @@ function getRessources(){
//// PUT AND PATCH TO API //// PUT AND PATCH TO API
function deleteOne(url, thatButton){ function deleteOne(url, thatButton){
console.warn("thatButton",thatButton)
// we just show wait image before ajax
var $thatButton = $(thatButton) if (typeof thatButton != 'undefined' && thatButton.id) {
var alreadyWaiting = $thatButton.has($('.wait-img-active')).length // we just show wait image before ajax
var $thatButton = $(thatButton)
if (! alreadyWaiting) { var alreadyWaiting = $thatButton.has($('.wait-img-active')).length
var previousButtonContent = $thatButton.html()
var availableWidth = $thatButton.width()
var $myWaitImg = $('#wait-img').clone() if (! alreadyWaiting ) {
$myWaitImg.attr("id", null) var previousButtonContent = $thatButton.html()
.attr("class","wait-img-active pull-right") var availableWidth = $thatButton.width()
.width(availableWidth) var $myWaitImg = $('#wait-img').clone()
.css("display", "block") ; $myWaitImg.attr("id", null)
$thatButton.append($myWaitImg) .attr("class","wait-img-active pull-right")
} .width(availableWidth)
else { .css("display", "block") ;
// uncomment if user should stop clicking ;) $thatButton.append($myWaitImg)
// $thatButton.addClass("btn-danger") }
// uncomment to prevent a 2nd ajax
return false
} }
// now the real ajax // now the real ajax
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment