diff --git a/data/js/controls.js b/data/js/controls.js index db9b7ff..e394c9f 100644 --- a/data/js/controls.js +++ b/data/js/controls.js @@ -650,29 +650,30 @@ function buttonclick(number, isdown) { } function padclick(type, number, isdown) { - if(!$("#id" + number + " nav").hasClass("disabled")) { - switch (type) { - case CENTER: - if (isdown) websock.send("pcdown:" + number); - else websock.send("pcup:" + number); - break; - case UP: - if (isdown) websock.send("pfdown:" + number); - else websock.send("pfup:" + number); - break; - case DOWN: - if (isdown) websock.send("pbdown:" + number); - else websock.send("pbup:" + number); - break; - case LEFT: - if (isdown) websock.send("pldown:" + number); - else websock.send("plup:" + number); - break; - case RIGHT: - if (isdown) websock.send("prdown:" + number); - else websock.send("prup:" + number); - break; - } + if($("#id" + number + " nav").hasClass("disabled")) { + return; + } + switch (type) { + case CENTER: + if (isdown) websock.send("pcdown:" + number); + else websock.send("pcup:" + number); + break; + case UP: + if (isdown) websock.send("pfdown:" + number); + else websock.send("pfup:" + number); + break; + case DOWN: + if (isdown) websock.send("pbdown:" + number); + else websock.send("pbup:" + number); + break; + case LEFT: + if (isdown) websock.send("pldown:" + number); + else websock.send("plup:" + number); + break; + case RIGHT: + if (isdown) websock.send("prdown:" + number); + else websock.send("prup:" + number); + break; } } diff --git a/data/js/controls.min.js b/data/js/controls.min.js index 0288c08..e3b5774 100644 --- a/data/js/controls.min.js +++ b/data/js/controls.min.js @@ -54,7 +54,8 @@ function textchange(number){var val=$("#text"+number).val();websock.send("tvalue function tabclick(number){var val=$("#tab"+number).val();websock.send("tabvalue:"+val+":"+number);} function selectchange(number){var val=$("#select"+number).val();websock.send("svalue:"+val+":"+number);} function buttonclick(number,isdown){if(isdown)websock.send("bdown:"+number);else websock.send("bup:"+number);} -function padclick(type,number,isdown){if(!$("#id"+number+" nav").hasClass("disabled")){switch(type){case CENTER:if(isdown)websock.send("pcdown:"+number);else websock.send("pcup:"+number);break;case UP:if(isdown)websock.send("pfdown:"+number);else websock.send("pfup:"+number);break;case DOWN:if(isdown)websock.send("pbdown:"+number);else websock.send("pbup:"+number);break;case LEFT:if(isdown)websock.send("pldown:"+number);else websock.send("plup:"+number);break;case RIGHT:if(isdown)websock.send("prdown:"+number);else websock.send("prup:"+number);break;}}} +function padclick(type,number,isdown){if($("#id"+number+" nav").hasClass("disabled")){return;} +switch(type){case CENTER:if(isdown)websock.send("pcdown:"+number);else websock.send("pcup:"+number);break;case UP:if(isdown)websock.send("pfdown:"+number);else websock.send("pfup:"+number);break;case DOWN:if(isdown)websock.send("pbdown:"+number);else websock.send("pbup:"+number);break;case LEFT:if(isdown)websock.send("pldown:"+number);else websock.send("plup:"+number);break;case RIGHT:if(isdown)websock.send("prdown:"+number);else websock.send("prup:"+number);break;}} function switcher(number,state){if(state==null){if(!$("#sl"+number).hasClass("checked")){websock.send("sactive:"+number);$("#sl"+number).addClass("checked");}else{websock.send("sinactive:"+number);$("#sl"+number).removeClass("checked");}}else if(state==1){$("#sl"+number).addClass("checked");$("#sl"+number).prop("checked",true);}else if(state==0){$("#sl"+number).removeClass("checked");$("#sl"+number).prop("checked",false);}} var rangeSlider=function(isDiscrete){var range=$(".range-slider__range");var slidercb=function(){sliderchange($(this).attr("id").replace(/^\D+/g,""));};range.on({input:function(){$(this).next().html(this.value)}});range.each(function(){$(this).next().html(this.value);if($(this).attr("callbackSet")!="true"){if(!isDiscrete){$(this).on({input:slidercb});}else{$(this).on({change:slidercb});} $(this).attr("callbackSet","true");}});};var addToHTML=function(data){panelStyle=data.hasOwnProperty('panelStyle')?" style='"+data.panelStyle+"' ":"";panelwide=data.hasOwnProperty('wide')?"wide":"";if(!data.hasOwnProperty('parentControl')||$("#tab"+data.parentControl).length>0){var parent=data.hasOwnProperty('parentControl')?$("#tab"+data.parentControl):$("#row");var html="";switch(data.type){case UI_LABEL:case UI_BUTTON:case UI_SWITCHER:case UI_CPAD:case UI_PAD:case UI_SLIDER:case UI_NUMBER:case UI_TEXT_INPUT:case UI_SELECT:case UI_GRAPH:case UI_GAUGE:case UI_ACCEL:html="