Reply To: Unselect Scale

PennController for IBEX Forums Requests Unselect Scale Reply To: Unselect Scale

#4116
Jeremy
Keymaster

EDIT: the unselect command was introduced in PennController 1.6.

Thanks for posting a request here Leo,

As a workaround, you can add this at the top of your script to add the command unselect (will only work with getScalenot with newScale):

var oldGetScale = getScale;
getScale = name => {
    let t = oldGetScale(name);
    t.unselect = ()=>{
        let e = t._element;
        t._promises.push(()=>new Promise(resolve=>{
            if (e.scaleType == "buttons")
              e.table.find("td.PennController-"+e.type+"-scaleButton").css("outline","");
            else if (e.scaleType == "slider"){
              let r = e.table.find("input[type=range]")[0];
              r.value = (r.max - r.min) / 2;
            }
            else
              e.table.find(".PennController-"+e.type+"-scaleButton input[type=radio]").removeAttr("checked");
            resolve();
        }));
        return t;
    };
    return t;
}; 

Jeremy

  • This reply was modified 4 years, 5 months ago by Jeremy. Reason: Command added to PennController 1.6