Skip to content

Commit

Permalink
Changelog:
Browse files Browse the repository at this point in the history
* Attempting to fix #215, please @Rudi-Batubara and @duduik test the latest master in your setups and let me know how it goes
* Updated V4 demo to showcase a fix for #215, added a tooltip for V3/V4 links in the main navigation
* Removed Google+ from share links in both V3/V4 demos
  • Loading branch information
thednp committed Jul 18, 2019
1 parent 7ff6c03 commit 0d892fd
Show file tree
Hide file tree
Showing 5 changed files with 195 additions and 194 deletions.
12 changes: 8 additions & 4 deletions dist/bootstrap-native-v4.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,12 @@
},
styleTip = function(link,element,position,parent) { // both popovers and tooltips (target,tooltip,placement,elementToAppendTo)
var elementDimensions = { w : element[offsetWidth], h: element[offsetHeight] },
windowWidth = (HTML[clientWidth] || DOC[body][clientWidth]),
windowHeight = (HTML[clientHeight] || DOC[body][clientHeight]),
windowOverflow = (HTML[offsetHeight] !== HTML.scrollHeight || HTML[offsetWidth] !== HTML.scrollWidth)
|| (parent[offsetWidth] !== parent.scrollWidth || parent[offsetHeight] !== parent.scrollHeight),
parentStyle = globalObject[getComputedStyle](link[parentNode]),
parentIsCenterAligned = parentStyle.alignItems === 'center' && parentStyle.justifyContent === 'center' && parentStyle.display === 'flex',
windowWidth = HTML[offsetWidth],
windowHeight = HTML[offsetHeight],
rect = link[getBoundingClientRect](),
scroll = parent === DOC[body] ? getScroll() : { x: parent[offsetLeft] + parent[scrollLeft], y: parent[offsetTop] + parent[scrollTop] },
linkDimensions = { w: rect[right] - rect[left], h: rect[bottom] - rect[top] },
Expand Down Expand Up @@ -327,8 +331,8 @@
leftPosition = windowWidth - elementDimensions.w*1.01;
arrowLeft = elementDimensions.w - ( windowWidth - rect[left] ) + linkDimensions.w/2 - arrowWidth/2;
} else {
leftPosition = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2;
arrowLeft = elementDimensions.w/2 - arrowWidth/2;
leftPosition = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + ( !isPopover && parentIsCenterAligned && windowOverflow ? arrowWidth/2 : 0 );
arrowLeft = elementDimensions.w/2 - ( isPopover ? arrowWidth : arrowWidth/2 );
}
}

Expand Down
Loading

0 comments on commit 0d892fd

Please sign in to comment.