-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1167f5d
Showing
394 changed files
with
548,493 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
4,200 changes: 4,200 additions & 0 deletions
4,200
_content/Blazorise.Bootstrap/blazorise.bootstrap.css
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import { addClassToBody, removeClassFromBody } from "../Blazorise/utilities.js?v=1.4.2.0"; | ||
|
||
export function open(element, scrollToTop) { | ||
adjustDialogDimensionsBeforeShow(element); | ||
|
||
var modals = Number(document.body.getAttribute("data-modals") || "0"); | ||
|
||
if (modals === 0) { | ||
addClassToBody("modal-open"); | ||
} | ||
|
||
modals += 1; | ||
|
||
document.body.setAttribute("data-modals", modals.toString()); | ||
|
||
if (scrollToTop) { | ||
const modalBody = element.querySelector('.modal-body'); | ||
|
||
if (modalBody) { | ||
modalBody.scrollTop = 0; | ||
} | ||
} | ||
} | ||
|
||
export function close(element) { | ||
var modals = Number(document.body.getAttribute("data-modals") || "0"); | ||
|
||
modals -= 1; | ||
|
||
if (modals < 0) { | ||
modals = 0; | ||
} | ||
|
||
if (modals === 0) { | ||
removeClassFromBody("modal-open"); | ||
} | ||
|
||
document.body.setAttribute("data-modals", modals.toString()); | ||
|
||
resetAdjustments(element); | ||
} | ||
|
||
export function adjustDialogDimensionsBeforeShow(element) { | ||
if (element) { | ||
const rect = document.body.getBoundingClientRect(); | ||
const isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth; | ||
const scrollbarWidth = getScrollBarWidth(); | ||
|
||
if (isBodyOverflowing) { | ||
const fixedContent = [].slice.call(document.querySelectorAll('.fixed-top, .fixed-bottom, .is-fixed, .sticky-top')); | ||
const stickyContent = [].slice.call(document.querySelectorAll('.sticky-top')); | ||
|
||
// Adjust fixed content padding | ||
if (fixedContent) { | ||
fixedContent.forEach((fixedContentElement) => { | ||
const calculatedPadding = fixedContentElement.style.paddingRight; | ||
|
||
fixedContentElement.style.paddingRight = `${parseFloat(calculatedPadding) + scrollbarWidth}px`; | ||
}); | ||
} | ||
|
||
// Adjust sticky content margin | ||
if (stickyContent) { | ||
stickyContent.forEach((stickyContentElement) => { | ||
const calculatedMargin = stickyContentElement.style.marginRight; | ||
|
||
stickyContentElement.style.marginRight = `${parseFloat(calculatedMargin) - scrollbarWidth}px`; | ||
}); | ||
} | ||
|
||
// Adjust body padding | ||
const calculatedPadding = document.body.style.paddingRight; | ||
|
||
document.body.style.paddingRight = `${calculatedPadding + scrollbarWidth}px`; | ||
} | ||
|
||
const isModalOverflowing = element.scrollHeight > document.documentElement.clientHeight; | ||
|
||
if (!isBodyOverflowing && isModalOverflowing) { | ||
element.style.paddingLeft = `${scrollbarWidth}px`; | ||
} | ||
|
||
if (isBodyOverflowing && !isModalOverflowing) { | ||
element.style.paddingRight = `${scrollbarWidth}px`; | ||
} | ||
} | ||
} | ||
export function resetAdjustments(element) { | ||
// Restore element padding | ||
if (element && element.style) { | ||
element.style.paddingLeft = '' | ||
element.style.paddingRight = ''; | ||
} | ||
|
||
const fixedContent = [].slice.call(document.querySelectorAll('.fixed-top, .fixed-bottom, .is-fixed, .sticky-top')); | ||
const stickyContent = [].slice.call(document.querySelectorAll('.sticky-top')); | ||
|
||
// Restore fixed content padding | ||
if (fixedContent) { | ||
fixedContent.forEach((fixedContentElement) => { | ||
fixedContentElement.style.paddingRight = ''; | ||
}); | ||
} | ||
|
||
// Restore sticky content | ||
if (stickyContent) { | ||
stickyContent.forEach((stickyContentElement) => { | ||
stickyContentElement.style.marginRight = ''; | ||
}); | ||
} | ||
|
||
// Restore body padding | ||
document.body.style.paddingRight = ''; | ||
} | ||
|
||
export function getScrollBarWidth() { | ||
const documentWidth = document.documentElement.clientWidth; | ||
return Math.abs(window.innerWidth - documentWidth); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { initialize as baseInitialize, destroy, updateContent } from "../Blazorise/tooltip.js?v=1.4.2.0"; | ||
|
||
export function initialize(element, elementId, options) { | ||
baseInitialize(element, elementId, options); | ||
|
||
if (options.autodetectInline && element && element.querySelector(".custom-control-input,.btn")) { | ||
element.classList.add("b-tooltip-inline"); | ||
} | ||
} | ||
|
||
export { destroy, updateContent }; |
Oops, something went wrong.