Skip to content

Instantly share code, notes, and snippets.

@cimfalab
Created August 12, 2017 04:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cimfalab/f8929bdb634030aba4aa94d9fbb1f004 to your computer and use it in GitHub Desktop.
Save cimfalab/f8929bdb634030aba4aa94d9fbb1f004 to your computer and use it in GitHub Desktop.
popup.alignment.js
_getAlignment: function() {
var ar, align;
if ( this.options.align ) {
ar = this.options.align.split( "," );
}
if ( ar && ar.length > 0 ) {
align = {
x: parseFloat( ar[ 0 ] ),
y: ar.length > 1 ? parseFloat( ar[ 1 ] ) : align.x
};
}
if ( align && !( isNaN( align.x ) || isNaN( align.y ) ) ) {
return {
x: this._alignmentToCoeffs( align.x ),
y: this._alignmentToCoeffs( align.y )
};
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment