580bf7de78a35e5d3fbbdc8171ffcf80a795f877 galt Thu Oct 22 19:46:56 2020 -0700 Fix speed of javascript in Matrix for hgTrackUi. fixes #26398 diff --git src/hg/js/hui.js src/hg/js/hui.js index 514f619..4aee971 100644 --- src/hg/js/hui.js +++ src/hg/js/hui.js @@ -307,57 +307,57 @@ matSubCBsetShadow(subCB,false); $(subCB).change(); // NOTE: if "subCfg" then 'change' event will update it hideOrShowSubtrack(subCB); } } function matSubCBsetShadow(subCB,triggerChange) { // Since CBs only get into cart when enabled/checked, // the shadow control enables cart to know other states // will update "subCfg" if needed var shadowState = 0; if (subCB.checked) shadowState = 1; if (isFauxDisabled(subCB,true)) shadowState -= 2; - var fourWay = normed($("input.cbShadow#boolshad\\."+subCB.id)); // fast using id GALT + var fourWay = normed($("input.cbShadow#boolshad\\."+subCB.id)); if (!fourWay) { warn("DEBUG: Failed to find fourWay shadow for '#"+subCB.id); return; } if ($(fourWay).val() !== shadowState.toString()) { $(fourWay).val(shadowState); if (typeof(subCfg) === "object") { // Is subCfg.js file included subCfg.enableCfg(subCB,(shadowState === 1)); if (triggerChange) $(subCB).change(); // 'change' event will update "subCfg" } } } function matChkBoxNormalize(matCB) { // Makes sure matCBs are in one of 3 states (checked,unchecked,indeterminate) // based on matching set of subCBs var classList = $( matCB ).attr("class").split(" "); var isABC = (aryFind(classList,"abc") !== -1); if (isABC) alert("ASSERT: matChkBoxNormalize() called for dim ABC!"); classList = aryRemove(classList,["matCB","changed","disabled"]); // create string filter of classes converting "matCB K562 H3K4me1" as ".K562.H3K4me1" var classes = '.' + classList.join("."); - var subCBs = $("input.subCB").filter(classes); // All subtrack CBs that match matrix CB + var subCBs = mtxSubMap[classes]; // All subtrack CBs that match matrix CB if (arguments.length > 1 && arguments[1].length > 0) { // dim ABC NOT classes subCBs = objsFilterByClasses(subCBs,"not",arguments[1]); } // Only look at visible views subCBs = $(subCBs).not('.disabled').not(":disabled"); if (subCBs.length > 0) { var CBsChecked = subCBs.filter(":checked"); if (!isABC) { if (CBsChecked.length === subCBs.length) { matCbComplete(matCB,true); $(matCB).attr('checked',true); } else if (CBsChecked.length === 0) {