MCPcopy Create free account
hub / github.com/PrairieLearn/PrairieLearn / setWidth

Function setWidth

public/javascripts/jquery.tablesorter.widgets.js:2308–2337  ·  view source on GitHub ↗
($orig, $clone)

Source from the content-addressed store, hash-verified

2306 laststate = '',
2307 spacing = 0,
2308 setWidth = function($orig, $clone){
2309 var index, width, border, $cell, $this,
2310 $cells = $orig.filter(':visible'),
2311 len = $cells.length;
2312 for ( index = 0; index < len; index++ ) {
2313 $cell = $clone.filter(':visible').eq(index);
2314 $this = $cells.eq(index);
2315 // code from https://github.com/jmosbech/StickyTableHeaders
2316 if ($this.css('box-sizing') === 'border-box') {
2317 width = $this.outerWidth();
2318 } else {
2319 if ($cell.css('border-collapse') === 'collapse') {
2320 if (window.getComputedStyle) {
2321 width = parseFloat( window.getComputedStyle($this[0], null).width );
2322 } else {
2323 // ie8 only
2324 border = parseFloat( $this.css('border-width') );
2325 width = $this.outerWidth() - parseFloat( $this.css('padding-left') ) - parseFloat( $this.css('padding-right') ) - border;
2326 }
2327 } else {
2328 width = $this.width();
2329 }
2330 }
2331 $cell.css({
2332 'width': width,
2333 'min-width': width,
2334 'max-width': width
2335 });
2336 }
2337 },
2338 resizeHeader = function() {
2339 stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0;
2340 spacing = 0;

Callers 1

resizeHeaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected