0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-11-22 09:17:56 +01:00

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

View File

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