Commit 338086c6 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

make button available considering checking

parent c7494123
......@@ -205,8 +205,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<th align="left" colspan="7">
With selection :
<div class="btn-group">
<button id="add_user" type="button" class="btn btn-small"><i class="icon-plus"></i> add user</button>
<button id="del_user" type="button" class="btn btn-small"><i class="icon-minus"></i> delete user</button>
<button id="add_user" type="button" class="btn nou-selection-btn btn-small"><i class="icon-plus"></i> add user</button>
<button id="del_user" type="button" class="btn multipleu-selection-btn btn-small"><i class="icon-minus"></i> delete user</button>
</div>
</th>
</tr>
......
......@@ -176,6 +176,14 @@ $(function () {
$("#chk_all_analysis").change(function() {
updateAnalysisButtonStatus();
});
updateUsersButtonStatus();
$("[id^=chk_user_]").change(function() {
updateUsersButtonStatus();
});
$("#chk_all_user").change(function() {
updateUsersButtonStatus();
});
// Init tables
var projectTable = initProjectTable(),
......@@ -651,6 +659,17 @@ function updateAnalysisButtonStatus() {
$(".noa-selection-btn").each(function(){ $(this).removeAttr('disabled'); });
}
function updateUsersButtonStatus() {
$('.multipleu-selection-btn').each(function(){
if ($(":checked[id^=chk_user_]").size() == 0) {
$(this).attr('disabled', 'disabled');
} else if ($(":checked[id^=chk_user_]").size() > 0) {
$(this).removeAttr('disabled');
}
});
$(".nou-selection-btn").each(function(){ $(this).removeAttr('disabled'); });
}
/* Run table init */
function initRunTable() {
var runTable = null ;
......
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