Skip to content

Commit b016b0e

Browse files
committed
clean up
1 parent ca8a2d2 commit b016b0e

File tree

5 files changed

+12
-20
lines changed

5 files changed

+12
-20
lines changed

js/bam/alignmentTrack.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,6 @@ class AlignmentTrack extends TrackBase {
889889
*
890890
* @param menuItem
891891
* @param showCheck
892-
* @returns {{init: undefined, name: undefined, click: clickHandler, element: (jQuery|HTMLElement|jQuery.fn.init)}}
893892
*/
894893
colorByCB(menuItem, showCheck) {
895894

@@ -953,7 +952,6 @@ class AlignmentTrack extends TrackBase {
953952
*
954953
* @param menuItem
955954
* @param showCheck
956-
* @returns {{init: undefined, name: undefined, click: clickHandler, element: (jQuery|HTMLElement|jQuery.fn.init)}}
957955
*/
958956
groupByCB(menuItem, showCheck) {
959957

js/cnvpytor/cnvpytorTrack.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ class CNVPytorTrack extends TrackBase {
237237
items.push('<hr/>')
238238
items.push("Bin Sizes")
239239
for (let rd_bin of this.available_bins) {
240-
const checkBox = createCheckbox(rd_bin, rd_bin === this.bin_size)
240+
241241
items.push({
242-
element: checkBox,
242+
element: createCheckbox(rd_bin, rd_bin === this.bin_size),
243243
click: async function binSizesHandler() {
244244
this.bin_size = rd_bin
245245
// data loader image
@@ -257,9 +257,9 @@ class CNVPytorTrack extends TrackBase {
257257

258258
let signal_dct = {"rd_snp": "RD and BAF Likelihood", "rd": "RD Signal", "snp": "BAF Likelihood"}
259259
for (let signal_name in signal_dct) {
260-
const checkBox = createCheckbox(signal_dct[signal_name], signal_name === this.signal_name)
260+
261261
items.push({
262-
element: checkBox,
262+
element: createCheckbox(signal_dct[signal_name], signal_name === this.signal_name),
263263
click: async function signalTypeHandler() {
264264
this.signal_name = signal_name
265265
await this.recreate_tracks(this.bin_size)
@@ -275,9 +275,9 @@ class CNVPytorTrack extends TrackBase {
275275
items.push('<hr/>')
276276
items.push("CNV caller")
277277
for (let cnv_caller of this.available_callers) {
278-
const checkBox = createCheckbox(cnv_caller, cnv_caller === this.cnv_caller)
278+
279279
items.push({
280-
element: checkBox,
280+
element: createCheckbox(cnv_caller, cnv_caller === this.cnv_caller),
281281
click: async function cnvCallerHandler() {
282282
this.cnv_caller = cnv_caller
283283
// data loader image

js/feature/featureTrack.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,12 @@ class FeatureTrack extends TrackBase {
362362

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

365-
const element = createCheckbox(`Color by ${colorScheme}`, colorScheme === this.colorBy)
366-
367365
function colorSchemeHandler() {
368366
this.colorBy = colorScheme
369367
this.trackView.repaintViews()
370368
}
371369

372-
menuItems.push({element, click: colorSchemeHandler})
370+
menuItems.push({element:createCheckbox(`Color by ${colorScheme}`, colorScheme === this.colorBy), click: colorSchemeHandler})
373371
}
374372
}
375373

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

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

387-
const element = createCheckbox(lut[displayMode], displayMode === this.displayMode)
388-
389385
function displayModeHandler() {
390386
this.displayMode = displayMode
391387
this.config.displayMode = displayMode
392388
this.trackView.checkContentHeight()
393389
this.trackView.repaintViews()
394390
}
395391

396-
menuItems.push({element, click: displayModeHandler})
392+
menuItems.push({element:createCheckbox(lut[displayMode], displayMode === this.displayMode), click: displayModeHandler})
397393
}
398394

399395
return menuItems

js/feature/segTrack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ class SegTrack extends TrackBase {
166166
menuItems.push("DisplayMode:")
167167
const displayOptions = this.type === 'seg' || this.type === 'shoebox' ? ["SQUISHED", "EXPANDED", "FILL"] : ["SQUISHED", "EXPANDED"]
168168
for (let displayMode of displayOptions) {
169-
const checkBox = createCheckbox(lut[displayMode], displayMode === this.displayMode)
169+
170170
menuItems.push(
171171
{
172-
element: checkBox,
172+
element: createCheckbox(lut[displayMode], displayMode === this.displayMode),
173173
click: function displayModeHandler() {
174174
this.displayMode = displayMode
175175
this.config.displayMode = displayMode

js/feature/wigTrack.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,13 @@ class WigTrack extends TrackBase {
173173
menuItems.push('<hr/>')
174174
menuItems.push("<div>Windowing function</div>")
175175
for (const wf of windowFunctions) {
176-
const element = createCheckbox(wf, this.windowFunction === wf)
177176

178177
function clickHandler() {
179178
this.windowFunction = wf
180179
this.trackView.updateViews()
181180
}
182181

183-
menuItems.push({element, click: clickHandler})
182+
menuItems.push({element:createCheckbox(wf, this.windowFunction === wf), click: clickHandler})
184183
}
185184

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

197196
for (const gt of graphType) {
198-
const element = createCheckbox(gt, this.graphType === gt)
199197

200198
function clickHandler() {
201199
this.graphType = gt
202200
this.trackView.repaintViews()
203201
}
204202

205-
menuItems.push({element, click: clickHandler})
203+
menuItems.push({element:createCheckbox(gt, this.graphType === gt), click: clickHandler})
206204
}
207205

208206
return menuItems

0 commit comments

Comments
 (0)