This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |