src/components/panel/panel.js
function getComputedTranslations(el, property) {
  // The transform being returned by `getComputedStyle` is in the format:
  // `matrix(a, b, c, d, translateX, translateY)` if defined and `none`
  // if the element doesn't have a transform.
  var transform = getComputedStyle(el[0] || el)[property];
  var openIndex = transform.indexOf('(');
  var closeIndex = transform.lastIndexOf(')');
  var output = { x: 0, y: 0 };

  if (openIndex > -1 && closeIndex > -1) {
    var parsedValues = transform
      .substring(openIndex + 1, closeIndex)
      .split(', ')
      .slice(-2);

    output.x = parseInt(parsedValues[0]);
    output.y = parseInt(parsedValues[1]);
  }

  return output;
}
function getComputedTranslations(el, property) {
  // The transform being returned by `getComputedStyle` is in the format:
  // `matrix(a, b, c, d, translateX, translateY)` if defined and `none`
  // if the element doesn't have a transform.
  var transform = getComputedStyle(el[0] || el)[property];
  var openIndex = transform.indexOf('(');
  var closeIndex = transform.lastIndexOf(')');
  var output = { x: 0, y: 0 };

  if (openIndex > -1 && closeIndex > -1) {
    var parsedValues = transform
      .substring(openIndex + 1, closeIndex)
      .split(', ')
      .slice(-2);

    output.x = parseInt(parsedValues[0]);
    output.y = parseInt(parsedValues[1]);
  }

  return output;
}
function getComputedTranslations ( el , property ) { // The transform being returned by `getComputedStyle` is in the format: // `matrix(a, b, c, d, translateX, translateY)` if defined and `none` // if the element doesn't have a transform. var transform = getComputedStyle ( el [ 0 ] || el ) [ property ] ; var openIndex = transform . indexOf ( '(' ) ; var closeIndex = transform . lastIndexOf ( ')' ) ; var output = { x : 0 , y : 0 } ; if ( openIndex > - 1 && closeIndex > - 1 ) { var parsedValues = transform . substring ( openIndex + 1 , closeIndex ) . split ( ', ' ) . slice ( - 2 ) ; output . x = parseInt ( parsedValues [ 0 ] ) ; output . y = parseInt ( parsedValues [ 1 ] ) ; } return output ; }
Gets the computed values for an element's translateX and translateY in px.
@param {!angular.JQLite|!Element} el
@param {string} property
@return {{x: number, y: number}}
Gets the computed values for an element s translateX and translateY in px .