From: Maciej Tronowski Date: Fri, 10 Apr 2015 09:24:45 +0000 (+0200) Subject: dynamically enable/disable action buttons (rename & disable) X-Git-Tag: v1.0~80 X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=commitdiff_plain;h=76066c4cd6557fe84369f538d69f64f8955bf03a;hp=4268b04e49c87d6373c094a41e77372328e87be1;p=qcg-portal.git dynamically enable/disable action buttons (rename & disable) --- diff --git a/qcg/templates/qcg/gridftp.html b/qcg/templates/qcg/gridftp.html index d0e77c1..2505b04 100644 --- a/qcg/templates/qcg/gridftp.html +++ b/qcg/templates/qcg/gridftp.html @@ -14,6 +14,13 @@ $(function () { var statusTimeout; + filex.files.on('change:checked', function() { + var selected = filex.selectedFiles().length; + + $('#btn-rename').toggleClass('disabled', selected != 1); + $('#btn-delete').toggleClass('disabled', selected == 0); + }); + $('#btn-upload').on('click', function() { var url = '{% url 'gridftp_upload' %}?' + $.param({host: filex.host, path: filex.path.full() + '/'}); @@ -135,8 +142,8 @@
- - + +