Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let ctxMenuButtonIds = [/*"clickHere",*/
- {name: "topNavbar-section-one",},
- {name: "breadcrumb-2-d", fixes: ['horizontalOffset', 'verticalOffset'],
- offsetH: 'calc(0px - (calc(pWidth - bWidth)*0.5))', offsetV: 'calc(bHeight + 10px)' },
- {name: "breadcrumb-3-d", fixes: ['horizontalOffset', 'verticalOffset'],
- offsetH: 'calc(0px - (calc(pWidth - bWidth)*0.5))', offsetV: 'calc(bHeight + 10px)' },
- {name: "breadcrumb-4-d", fixes: ['horizontalOffset', 'verticalOffset'],
- offsetH: 'calc(0px - (calc(pWidth - bWidth)*0.5))', offsetV: 'calc(bHeight + 10px)' },
- ];
- //...
- let buttonOffsetInfo = getOffset(btn)
- popup.classList.remove("popup-showing");
- popup.classList.add("popup-showing");
- //Display needs to be showing otherwise offsetX and offsetY are nothing
- if (info.fixes && info.fixes.includes('horizontalOffset') && info.offsetH) {
- let posX_b = buttonOffsetInfo.left
- let width_b = btn.offsetWidth
- let calc_string = info.offsetH
- console.log('width_b: '+width_b)
- calc_string = calc_string.replace(/bWidth/g, width_b+'px')
- calc_string = calc_string.replace(/pWidth/g, popup.offsetWidth+'px')
- // NOTE: NOTE - Display is hidden, so won't width be 0?
- //console.log(calc_string)
- console.log(`calc(${posX_b}px + ${calc_string})`)
- popup.style.left = `calc(${posX_b}px + ${calc_string})`
- } else popup.style.left = `${position.x + 3}px`;
- if (info.fixes && info.fixes.includes('verticalOffset') && info.offsetV) {
- let posY_b = buttonOffsetInfo.top
- let height_b = btn.offsetHeight
- let calc_string = info.offsetV
- calc_string = calc_string.replace(/bHeight/g, height_b+'px')
- calc_string = calc_string.replace(/pHeight/g, popup.offsetHeight+'px')
- //console.log(calc_string)
- console.log(`calc(${posY_b}px + ${calc_string})`)
- popup.style.top = `calc(${posY_b}px + ${calc_string})`
- } else popup.style.top = `${position.y + 3}px`;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement