diff --git a/shell/utils/position.js b/shell/utils/position.js index 69ec5fb7c9..b2529e9967 100644 --- a/shell/utils/position.js +++ b/shell/utils/position.js @@ -1,5 +1,4 @@ // @TODO replace this with popper.js... -import $ from 'jquery'; export const LEFT = 'left'; export const RIGHT = 'right'; @@ -10,10 +9,9 @@ export const BOTTOM = 'bottom'; export const AUTO = 'auto'; export function boundingRect(elem) { - const $elem = $(elem); - const pos = $elem.offset(); - const width = $elem.outerWidth(false); - const height = $elem.outerHeight(false); + const pos = elem.getBoundingClientRect(); + const width = elem.offsetWidth; + const height = elem.offsetHeight; return { top: pos.top, @@ -37,9 +35,8 @@ export function fakeRectFor(event) { } export function screenRect() { - const $window = $(window); - const width = $window.width(); - const height = $window.height(); + const width = window.innerWidth; + const height = window.innerHeight; const top = window.pageYOffset; const left = window.pageXOffset; diff --git a/shell/utils/select.js b/shell/utils/select.js index 48fea09626..2d4266b04a 100644 --- a/shell/utils/select.js +++ b/shell/utils/select.js @@ -1,5 +1,3 @@ -import $ from 'jquery'; - export function onClickOption(option, e) { if (!this.$attrs.multiple) { return; @@ -29,7 +27,7 @@ export function onClickOption(option, e) { // We used to use popper for these, but it does not suppotr fractional pixel placements which // means the dropdown does not appear aligned to the control when placed in a column-based layout export function calculatePosition(dropdownList, component, width, placement) { - const selectEl = $(component.$parent.$el)[0]; + const selectEl = component.$parent.$el; const r = selectEl.getBoundingClientRect(); const p = placement || 'bottom-start'; const docHeight = document.body.offsetHeight;