Commit 1018b53f authored by Jerome Mariette's avatar Jerome Mariette
Browse files

make button available considering checking

parent 0df0fcf6
......@@ -79,16 +79,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<th align="left" colspan="4">
With selection :
<div class="btn-group">
<button id="hide_project" type="button" class="btn btn-small"><i class=" icon-eye-close"></i> hide</button>
<button id="unhide_project" type="button" class="btn btn-small"><i class="icon-eye-open"></i> unhide</button>
<button id="hide_project" type="button" class="btn multiple-selection-btn btn-small"><i class=" icon-eye-close"></i> hide</button>
<button id="unhide_project" type="button" class="btn multiple-selection-btn btn-small"><i class="icon-eye-open"></i> unhide</button>
</div>
<div class="btn-group">
<button id="publish_project" type="button" class="btn btn-small"><i class="icon-thumbs-up"></i> publish</button>
<button id="unpublish_project" type="button" class="btn btn-small"><i class="icon-thumbs-down"></i> unpublish</button>
<button id="publish_project" type="button" class="btn multiple-selection-btn btn-small"><i class="icon-thumbs-up"></i> publish</button>
<button id="unpublish_project" type="button" class="btn multiple-selection-btn btn-small"><i class="icon-thumbs-down"></i> unpublish</button>
</div>
<button id="add_project" type="button" class="btn no-selection-btn btn-small"><i class="icon-plus"></i> add</button>
<div class="btn-group">
<button id="add_project" type="button" class="btn btn-small"><i class="icon-plus"></i> add</button>
<button id="delete_project" type="button" class="btn btn-small"><i class="icon-minus"></i> delete</button>
<button id="delete_project" type="button" class="btn multiple-selection-btn btn-small"><i class="icon-minus"></i> delete</button>
</div>
</th>
</tr>
......
......@@ -258,20 +258,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div id="modal-foot-tmpl" class="modal-footer"></div>
</div>
{* Error No raw selected modal *}
<div id="ng6modal-DTnoraw" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="modalLabel-DTnoraw" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Error</h3>
</div>
<div class="modal-body">
<div class='tx-nG6-pi1-error'>No raw selected, please select a raw to access this fonctionality.</div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><i class="icon-remove"></i> Close</button>
</div>
</div>
{* setAndRunModal *}
<div id="setAndRunModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="setAndRunModalLabel" aria-hidden="true">
<div class="modal-header">
......
......@@ -147,20 +147,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div id="modal-foot-tmpl" class="modal-footer"></div>
</div>
{* Error No raw selected modal *}
<div id="ng6modal-DTnoraw" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="modalLabel-DTnoraw" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Error</h3>
</div>
<div class="modal-body">
<div class='tx-nG6-pi1-error'>No raw selected, please select a raw to access this fonctionality.</div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><i class="icon-remove"></i> Close</button>
</div>
</div>
{* setAndRunModal *}
<div id="setAndRunModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="setAndRunModalLabel" aria-hidden="true">
<div class="modal-header">
......
......@@ -150,6 +150,8 @@ jQuery.extend( jQuery.fn.dataTableExt.oSort, {
$(function () {
initEditableFields();
initCheckboxes();
......@@ -159,6 +161,15 @@ $(function () {
analysisTable = initAnalysisTable(),
usersTable = initUsersTable();
updateProjectButtonStatus();
$("[id^=chk_project_]").change(function() {
updateProjectButtonStatus();
});
$("#chk_all_project").change(function() {
updateProjectButtonStatus();
});
// Grab relevant info from URL fragment
var params = simpleQueryParams(location.href),
active_tab = params["active_tab"];
......@@ -335,9 +346,7 @@ $(function () {
}
});
});
} else {
$("#ng6modal-DTnoraw").modal();
}
}
});
/* add user to project option */
......@@ -596,6 +605,17 @@ $(function () {
});
function updateProjectButtonStatus() {
$('.multiple-selection-btn').each(function(){
if ($(":checked[id^=chk_project_]").size() == 0) {
$(this).attr('disabled', 'disabled');
} else if ($(":checked[id^=chk_project_]").size() > 0) {
$(this).removeAttr('disabled');
}
});
$(".no-selection-btn").each(function(){ $(this).removeAttr('disabled'); });
}
/* Run table init */
function initRunTable() {
var runTable = null ;
......@@ -851,9 +871,7 @@ function deletePRAHandler() {
});
});
});
} else {
$("#ng6modal-DTnoraw").modal();
}
}
}
function hideHandler() {
......@@ -901,8 +919,6 @@ function hideHandler() {
}
});
});
} else {
$("#ng6modal-DTnoraw").modal();
}
}
......@@ -941,8 +957,6 @@ function unhideHandler() {
}
});
});
} else {
$("#ng6modal-DTnoraw").modal();
}
}
......@@ -979,8 +993,6 @@ function unpublishHandler() {
}
});
});
} else {
$("#ng6modal-DTnoraw").modal();
}
}
......@@ -1022,8 +1034,6 @@ function publishHandler () {
}
});
});
} else {
$("#ng6modal-DTnoraw").modal();
}
}
......
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