Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
turner committed Jan 16, 2025
1 parent ca8a2d2 commit b016b0e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 20 deletions.
2 changes: 0 additions & 2 deletions js/bam/alignmentTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,6 @@ class AlignmentTrack extends TrackBase {
*
* @param menuItem
* @param showCheck
* @returns {{init: undefined, name: undefined, click: clickHandler, element: (jQuery|HTMLElement|jQuery.fn.init)}}
*/
colorByCB(menuItem, showCheck) {

Expand Down Expand Up @@ -953,7 +952,6 @@ class AlignmentTrack extends TrackBase {
*
* @param menuItem
* @param showCheck
* @returns {{init: undefined, name: undefined, click: clickHandler, element: (jQuery|HTMLElement|jQuery.fn.init)}}
*/
groupByCB(menuItem, showCheck) {

Expand Down
12 changes: 6 additions & 6 deletions js/cnvpytor/cnvpytorTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ class CNVPytorTrack extends TrackBase {
items.push('<hr/>')
items.push("Bin Sizes")
for (let rd_bin of this.available_bins) {
const checkBox = createCheckbox(rd_bin, rd_bin === this.bin_size)

items.push({
element: checkBox,
element: createCheckbox(rd_bin, rd_bin === this.bin_size),
click: async function binSizesHandler() {
this.bin_size = rd_bin
// data loader image
Expand All @@ -257,9 +257,9 @@ class CNVPytorTrack extends TrackBase {

let signal_dct = {"rd_snp": "RD and BAF Likelihood", "rd": "RD Signal", "snp": "BAF Likelihood"}
for (let signal_name in signal_dct) {
const checkBox = createCheckbox(signal_dct[signal_name], signal_name === this.signal_name)

items.push({
element: checkBox,
element: createCheckbox(signal_dct[signal_name], signal_name === this.signal_name),
click: async function signalTypeHandler() {
this.signal_name = signal_name
await this.recreate_tracks(this.bin_size)
Expand All @@ -275,9 +275,9 @@ class CNVPytorTrack extends TrackBase {
items.push('<hr/>')
items.push("CNV caller")
for (let cnv_caller of this.available_callers) {
const checkBox = createCheckbox(cnv_caller, cnv_caller === this.cnv_caller)

items.push({
element: checkBox,
element: createCheckbox(cnv_caller, cnv_caller === this.cnv_caller),
click: async function cnvCallerHandler() {
this.cnv_caller = cnv_caller
// data loader image
Expand Down
8 changes: 2 additions & 6 deletions js/feature/featureTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,12 @@ class FeatureTrack extends TrackBase {

for (const colorScheme of ["function", "class"]) {

const element = createCheckbox(`Color by ${colorScheme}`, colorScheme === this.colorBy)

function colorSchemeHandler() {
this.colorBy = colorScheme
this.trackView.repaintViews()
}

menuItems.push({element, click: colorSchemeHandler})
menuItems.push({element:createCheckbox(`Color by ${colorScheme}`, colorScheme === this.colorBy), click: colorSchemeHandler})
}
}

Expand All @@ -384,16 +382,14 @@ class FeatureTrack extends TrackBase {

for (const displayMode of ["COLLAPSED", "SQUISHED", "EXPANDED"]) {

const element = createCheckbox(lut[displayMode], displayMode === this.displayMode)

function displayModeHandler() {
this.displayMode = displayMode
this.config.displayMode = displayMode
this.trackView.checkContentHeight()
this.trackView.repaintViews()
}

menuItems.push({element, click: displayModeHandler})
menuItems.push({element:createCheckbox(lut[displayMode], displayMode === this.displayMode), click: displayModeHandler})
}

return menuItems
Expand Down
4 changes: 2 additions & 2 deletions js/feature/segTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ class SegTrack extends TrackBase {
menuItems.push("DisplayMode:")
const displayOptions = this.type === 'seg' || this.type === 'shoebox' ? ["SQUISHED", "EXPANDED", "FILL"] : ["SQUISHED", "EXPANDED"]
for (let displayMode of displayOptions) {
const checkBox = createCheckbox(lut[displayMode], displayMode === this.displayMode)

menuItems.push(
{
element: checkBox,
element: createCheckbox(lut[displayMode], displayMode === this.displayMode),
click: function displayModeHandler() {
this.displayMode = displayMode
this.config.displayMode = displayMode
Expand Down
6 changes: 2 additions & 4 deletions js/feature/wigTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,13 @@ class WigTrack extends TrackBase {
menuItems.push('<hr/>')
menuItems.push("<div>Windowing function</div>")
for (const wf of windowFunctions) {
const element = createCheckbox(wf, this.windowFunction === wf)

function clickHandler() {
this.windowFunction = wf
this.trackView.updateViews()
}

menuItems.push({element, click: clickHandler})
menuItems.push({element:createCheckbox(wf, this.windowFunction === wf), click: clickHandler})
}

return menuItems
Expand All @@ -195,14 +194,13 @@ class WigTrack extends TrackBase {
menuItems.push("<div>Graph type</div>")

for (const gt of graphType) {
const element = createCheckbox(gt, this.graphType === gt)

function clickHandler() {
this.graphType = gt
this.trackView.repaintViews()
}

menuItems.push({element, click: clickHandler})
menuItems.push({element:createCheckbox(gt, this.graphType === gt), click: clickHandler})
}

return menuItems
Expand Down

0 comments on commit b016b0e

Please sign in to comment.