add disabled styling for go button

This commit is contained in:
Stephen Birarda 2015-12-22 15:41:14 -07:00
parent ddd51264d9
commit a30d7ee697
2 changed files with 19 additions and 6 deletions

View file

@ -23,7 +23,7 @@ body {
letter-spacing: 0.075rem;
}
input, textarea, select, a {
input, textarea, select, a, button {
outline: none;
}
@ -203,12 +203,18 @@ header {
margin-left: @title-margin-left;
#go-server-button {
box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.5);
cursor: pointer;
border: none;
margin-top: 10px;
background-color: #08A6E0;
background-color: #129EC0;
width: 150px;
&.disabled {
cursor: default;
background-color: #86888F;
}
img {
padding: 10px 0px;
width: 50px;

View file

@ -47,8 +47,6 @@ $(function() {
processCircle.attr('class', 'circle stopping');
break;
case HFProcess.ProcessStates.STARTED:
processCircle.attr('class', 'circle started');
break;
}
@ -57,16 +55,25 @@ $(function() {
function onProcessGroupUpdate(event, arg) {
var sendingGroup = arg;
var stopButton = $('#manage-server #stop');
var goButton = $('#go-server-button');
switch (sendingGroup.state) {
case HFProcess.ProcessGroupStates.STOPPED:
case HFProcess.ProcessGroupStates.STOPPING:
// if the process group is stopping, the stop button should be disabled
toggleManageButton(stopButton, false);
// disable the go button
goButton.addClass('disabled');
break;
case HFProcess.ProcessGroupStates.STARTED:
// if the process group is going, the stop button should be active
toggleManageButton(stopButton, true);
// enable the go button
goButton.removeClass('disabled');
break;
}
}
@ -74,8 +81,8 @@ $(function() {
$('#last-visited-link').click(function() {
ipcRenderer.send('start-interface');
});
$('#go-server-button').click(function(){
$('#go-server-button:not(.disabled)').click(function(){
ipcRenderer.send('start-interface', { url: 'hifi://localhost' });
})