ASP_MVC webClient tillagd
This commit is contained in:
11
MVCUI/Scripts/src/utils/getOppositePlacement.js
Normal file
11
MVCUI/Scripts/src/utils/getOppositePlacement.js
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Get the opposite placement of the given one
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {String} placement
|
||||
* @returns {String} flipped placement
|
||||
*/
|
||||
export default function getOppositePlacement(placement) {
|
||||
const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
||||
return placement.replace(/left|right|bottom|top/g, matched => hash[matched]);
|
||||
}
|
||||
Reference in New Issue
Block a user