* @private
*/
_setPosition() {
+ this.$element.removeClass(`has-position-${this.position} has-alignment-${this.alignment}`);
super._setPosition(this.$currentAnchor, this.$element, this.$parent);
+ this.$element.addClass(`has-position-${this.position} has-alignment-${this.alignment}`);
}
/**
this.triedPositions = {};
this.position = this.options.position === 'auto' ? this._getDefaultPosition() : this.options.position;
this.alignment = this.options.alignment === 'auto' ? this._getDefaultAlignment() : this.options.alignment;
+ this.originalPosition = this.position;
+ this.originalAlignment = this.alignment;
}
_getDefaultPosition () {
$anchorDims = Box.GetDimensions($anchor);
+ if (!this.options.allowOverlap) {
+ // restore original position & alignment before checking overlap
+ this.position = this.originalPosition;
+ this.alignment = this.originalAlignment;
+ }
+
$element.offset(Box.GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));
if(!this.options.allowOverlap) {