Remove event handler from stop butten when disabled

This commit is contained in:
peteruithoven 2013-10-12 17:30:39 +02:00
parent 51d44c9086
commit af325f4bd3
1 changed files with 4 additions and 1 deletions

View File

@ -185,7 +185,7 @@ function initButtonBehavior() {
})
//*/
btnStop.on('touchstart mousedown',stopPrint);
//btnStop.on('touchstart mousedown',stopPrint);
}
function stopPrint() {
console.log("f:stopPrint() >> sendPrintCommands = " + sendPrintCommands);
@ -321,8 +321,11 @@ function setState(newState,newHasControl) { //TODO add hasControl
var stopEnabled = ((newState == Printer.PRINTING_STATE || newState == Printer.BUFFERING_STATE) && newHasControl);
if(stopEnabled) {
btnStop.removeClass("disabled");
btnStop.unbind('touchstart mousedown');
btnStop.bind('touchstart mousedown',stopPrint);
} else {
btnStop.addClass("disabled");
btnStop.unbind('touchstart mousedown');
}
// thermometer