Skip to content

Instantly share code, notes, and snippets.

View components.table-grid-cell.js
import Ember from 'ember';
// no one will ever need more than 100000 cells.
const TOP_CELL_ZINDEX = 100000;
function _toSum(sumOfPreviousDimensions, cssValue) {
const separatedNumberAndUnitIdentifier = /(\d+)\s*(\w+)/
// '100px' => ['100px', '100', 'px'];
const [, curValue, curUnit] = cssValue.match(separatedNumberAndUnitIdentifier);
const [, prevValue, prevUnit] = sumOfPreviousDimensions.match(separatedNumberAndUnitIdentifier);