From a30d7ee697e3e27894ff6e19ac51a9b6f1745c40 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 22 Dec 2015 15:41:14 -0700 Subject: [PATCH] add disabled styling for go button --- console/src/css/style.less | 10 ++++++++-- console/src/index.js | 15 +++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/console/src/css/style.less b/console/src/css/style.less index 613dd89693..9260680fbb 100644 --- a/console/src/css/style.less +++ b/console/src/css/style.less @@ -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; diff --git a/console/src/index.js b/console/src/index.js index dd7af7f754..2eba4ba1c7 100755 --- a/console/src/index.js +++ b/console/src/index.js @@ -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' }); })