@@ -1337,6 +1337,12 @@ MdPanelRef.prototype._updatePosition = function(init) {
13371337 var positionConfig = this . config [ 'position' ] ;
13381338
13391339 if ( positionConfig ) {
1340+ // Use the vendor prefixed version of transform.
1341+ // Note that the offset should be assigned before the position, in
1342+ // order to avoid tiny jumps in the panel's position, on slower browsers.
1343+ var prefixedTransform = this . _$mdConstant . CSS . TRANSFORM ;
1344+ this . panelEl . css ( prefixedTransform , positionConfig . getTransform ( ) ) ;
1345+
13401346 positionConfig . _setPanelPosition ( this . panelEl ) ;
13411347
13421348 // Hide the panel now that position is known.
@@ -1360,10 +1366,6 @@ MdPanelRef.prototype._updatePosition = function(init) {
13601366 MdPanelPosition . absPosition . RIGHT ,
13611367 positionConfig . getRight ( )
13621368 ) ;
1363-
1364- // Use the vendor prefixed version of transform.
1365- var prefixedTransform = this . _$mdConstant . CSS . TRANSFORM ;
1366- this . panelEl . css ( prefixedTransform , positionConfig . getTransform ( ) ) ;
13671369 }
13681370} ;
13691371
@@ -2003,7 +2005,7 @@ MdPanelPosition.prototype._validateXPosition = function(xPosition) {
20032005/**
20042006 * Sets the value of the offset in the x-direction. This will add to any
20052007 * previously set offsets.
2006- * @param {string } offsetX
2008+ * @param {string|function(MdPanelPosition): string } offsetX
20072009 * @returns {!MdPanelPosition }
20082010 */
20092011MdPanelPosition . prototype . withOffsetX = function ( offsetX ) {
@@ -2015,7 +2017,7 @@ MdPanelPosition.prototype.withOffsetX = function(offsetX) {
20152017/**
20162018 * Sets the value of the offset in the y-direction. This will add to any
20172019 * previously set offsets.
2018- * @param {string } offsetY
2020+ * @param {string|function(MdPanelPosition): string } offsetY
20192021 * @returns {!MdPanelPosition }
20202022 */
20212023MdPanelPosition . prototype . withOffsetY = function ( offsetY ) {
@@ -2117,8 +2119,11 @@ MdPanelPosition.prototype.getActualPosition = function() {
21172119MdPanelPosition . prototype . _reduceTranslateValues =
21182120 function ( translateFn , values ) {
21192121 return values . map ( function ( translation ) {
2120- return translateFn + '(' + translation + ')' ;
2121- } ) . join ( ' ' ) ;
2122+ // TODO(crisbeto): this should add the units after #9609 is merged.
2123+ var translationValue = angular . isFunction ( translation ) ?
2124+ translation ( this ) : translation ;
2125+ return translateFn + '(' + translationValue + ')' ;
2126+ } , this ) . join ( ' ' ) ;
21222127 } ;
21232128
21242129
0 commit comments