0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-06-02 04:34:32 +02:00

Disabling prev, next and save buttons for now (code ready to enable/disable according to state) #41

This commit is contained in:
peteruithoven 2013-10-29 15:09:07 +01:00
parent 5f15b9945c
commit 8745e037a4

View File

@ -37,6 +37,7 @@ function initButtonBehavior() {
btnPrevious = $(".btnPrevious"); btnPrevious = $(".btnPrevious");
btnNext = $(".btnNext"); btnNext = $(".btnNext");
btnSave = $(".btnSave");
//debug //debug
//btnDebug = $(".debugBtn"); //btnDebug = $(".debugBtn");
@ -44,12 +45,6 @@ function initButtonBehavior() {
btnNew.on('touchstart mousedown', clearDoodle); btnNew.on('touchstart mousedown', clearDoodle);
btnPrint.on('touchstart mousedown', print); 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) { // btnClear.click(function(e) {
// e.preventDefault(); // e.preventDefault();
// // console.log("clear"); // // console.log("clear");
@ -392,6 +387,25 @@ function setState(newState,newHasControl) {
enableButton(btnSettings, openSettingsWindow); enableButton(btnSettings, openSettingsWindow);
break; 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) { if(newState == Printer.WIFIBOX_DISCONNECTED_STATE) {
message.set("Lost connection to WiFi box",Message.ERROR); message.set("Lost connection to WiFi box",Message.ERROR);