From 5cd1ed2404a030ab6e09e9beb26614aab26d49cd Mon Sep 17 00:00:00 2001 From: gebele Date: Tue, 12 Dec 2017 14:51:57 +0000 Subject: extended execution rule for tasks --- views/batch.haml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/views/batch.haml b/views/batch.haml index c770247..c71d056 100644 --- a/views/batch.haml +++ b/views/batch.haml @@ -125,9 +125,19 @@ :javascript var timer = #{ctimer}; $(document).ready(function(){ - markers[#{idx}] = setInterval(function(){ - renderTask('#{task}','#{model}',#{idx}); - }, timer ); + // check button class before execute a task + if (#{idx} > 0){ + markers[#{idx}] = setInterval(function(){ + var button = document.getElementById("detailsbutton_#{idx-1}"); + if(!button.classList.contains('disabled')){ + renderTask('#{task}','#{model}',#{idx}); + } + }, timer ); + }else{ + markers[#{idx}] = setInterval(function(){ + renderTask('#{task}','#{model}',#{idx}); + }, timer ); + }; }); #data-container{:id=>idx,:style=>"width:100%;"} -#pager{:id=>idx} -- cgit v1.2.3