MCPcopy Create free account
hub / github.com/compat-table/compat-table / highlightSelected

Function highlightSelected

master.js:275–297  ·  view source on GitHub ↗
(elem)

Source from the content-addressed store, hash-verified

273
274 // Cell highlighting function
275 function highlightSelected(elem) {
276 var win = $(window);
277 var left = win.scrollLeft();
278 table.detach().find('.selected').removeClass('selected');
279
280 elem.addClass('selected');
281
282 // Trigger `click` event on supertest to open dropdown.
283 if (!elem.is('.parent') && elem.is('.subtest:hidden')) {
284 var supertest = elem.prevUntil('.supertest').prev();
285 // If there are no other subtests before this, `prevUntil`
286 // will return an empty jQuery object. To select the supertest,
287 // we can just select the previous element.
288 if (!supertest.length) {
289 supertest = elem.prev();
290 }
291 supertest.triggerHandler('click');
292 }
293
294 table.addClass('one-selected').insertBefore('#footnotes');
295 win.scrollLeft(left);
296 table.triggerHandler('reflow');
297 }
298
299 $(document).on('click', function removeHighlighting(event) {
300 // Don't remove all dimming if another link was clicked in this event.

Callers 1

master.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected