Merge branch 'feature/printerdriver' of https://github.com/Doodle3D/doodle3d-client into feature/printerdriver

# By peteruithoven
# Via peteruithoven
* 'feature/printerdriver' of https://github.com/Doodle3D/doodle3d-client:
  Disabling prev, next and save buttons for now (code ready to enable/disable according to state) #41
This commit is contained in:
Adriaan Wormgoor 2013-10-29 21:27:23 +01:00
commit 176f8f4ae1
1 changed files with 20 additions and 6 deletions

View File

@ -37,6 +37,7 @@ function initButtonBehavior() {
btnPrevious = $(".btnPrevious");
btnNext = $(".btnNext");
btnSave = $(".btnSave");
//debug
//btnDebug = $(".debugBtn");
@ -44,12 +45,6 @@ function initButtonBehavior() {
btnNew.on('touchstart mousedown', clearDoodle);
btnPrint.on('touchstart mousedown', print);
// not using these at the moment
$("#btnPrevious").css("opacity", "0.3");
btnNext.css("opacity", "0.3");
$("#btnSave").css("opacity", "0.3");
// btnInfo.css("opacity", "0.3");
// btnClear.click(function(e) {
// e.preventDefault();
// // console.log("clear");
@ -397,6 +392,25 @@ function setState(newState,newHasControl) {
enableButton(btnSettings, openSettingsWindow);
break;
}
/* save, next and prev buttons */
switch(newState) {
/*case Printer.WIFIBOX_DISCONNECTED_STATE:
disableButton(btnPrevious);
disableButton(btnNext);
disableButton(btnSave);
break;
default:
enableButton(btnPrevious, null);
enableButton(btnNext, null);
enableButton(btnSave, null);
break;*/
default:
disableButton(btnPrevious);
disableButton(btnNext);
disableButton(btnSave);
break;
}
if(newState == Printer.WIFIBOX_DISCONNECTED_STATE) {
message.set("Lost connection to WiFi box",Message.ERROR);