added button state for files which no actions are available for

This commit is contained in:
Hauke Klement
2015-03-21 12:40:58 +01:00
parent 5ec0a82157
commit 49f5ab061a
6 changed files with 15 additions and 1 deletions

View File

@@ -156,6 +156,10 @@ $(function() {
jqxhr.fail(ajaxError);
};
var fileActionsAvailable = function() {
return isActiveFileRenderable() || isActiveFileRunnable() || isActiveFileStoppable() || isActiveFileTestable();
};
var findOrCreateOutputElement = function(index) {
if ($('#output-' + index).isPresent()) {
return $('#output-' + index);
@@ -644,6 +648,8 @@ $(function() {
$('#dropdown-run').toggleClass('disabled', !isActiveFileRunnable() || running);
$('#dropdown-stop').toggleClass('disabled', !isActiveFileStoppable());
$('#dropdown-test').toggleClass('disabled', !isActiveFileTestable());
$('#dummy').toggle(!fileActionsAvailable());
$('#editor-buttons .dropdown-toggle').toggle(fileActionsAvailable());
$('#render').toggle(isActiveFileRenderable());
$('#run').toggle(isActiveFileRunnable() && !running);
$('#stop').toggle(isActiveFileStoppable());