Content-Length: 331840 | pFad | https://github.com/bootstrap-vue/bootstrap-vue/commit/b0f5f63369595c57b6c1f1387ff0b8e2f76ed6c9

97 chore(refactor): prefer multiple constants over contants object · bootstrap-vue/bootstrap-vue@b0f5f63 · GitHub
Skip to content

Commit b0f5f63

Browse files
committed
chore(refactor): prefer multiple constants over contants object
1 parent 8aeb9e9 commit b0f5f63

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/components/modal/helpers/modal-manager.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ import { toFloat, toInteger } from '../../../utils/number'
2929
const DEFAULT_ZINDEX = 1040
3030

3131
// Selectors for padding/margin adjustments
32-
const Selector = {
33-
FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
34-
STICKY_CONTENT: '.sticky-top',
35-
NAVBAR_TOGGLER: '.navbar-toggler'
36-
}
32+
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'
33+
const SELECTOR_STICKY_CONTENT = '.sticky-top'
34+
const SELECTOR_NAVBAR_TOGGLER = '.navbar-toggler'
3735

3836
// --- Main component ---
3937

@@ -161,23 +159,23 @@ const ModalManager = /*#__PURE__*/ Vue.extend({
161159
const scrollbarWidth = this.scrollbarWidth
162160
// Adjust fixed content padding
163161
/* istanbul ignore next: difficult to test in JSDOM */
164-
selectAll(Selector.FIXED_CONTENT).forEach(el => {
162+
selectAll(SELECTOR_FIXED_CONTENT).forEach(el => {
165163
const actualPadding = getStyle(el, 'paddingRight') || ''
166164
setAttr(el, 'data-padding-right', actualPadding)
167165
setStyle(el, 'paddingRight', `${toFloat(getCS(el).paddingRight, 0) + scrollbarWidth}px`)
168166
body._paddingChangedForModal.push(el)
169167
})
170168
// Adjust sticky content margin
171169
/* istanbul ignore next: difficult to test in JSDOM */
172-
selectAll(Selector.STICKY_CONTENT).forEach(el => /* istanbul ignore next */ {
170+
selectAll(SELECTOR_STICKY_CONTENT).forEach(el => /* istanbul ignore next */ {
173171
const actualMargin = getStyle(el, 'marginRight') || ''
174172
setAttr(el, 'data-margin-right', actualMargin)
175173
setStyle(el, 'marginRight', `${toFloat(getCS(el).marginRight, 0) - scrollbarWidth}px`)
176174
body._marginChangedForModal.push(el)
177175
})
178176
// Adjust <b-navbar-toggler> margin
179177
/* istanbul ignore next: difficult to test in JSDOM */
180-
selectAll(Selector.NAVBAR_TOGGLER).forEach(el => /* istanbul ignore next */ {
178+
selectAll(SELECTOR_NAVBAR_TOGGLER).forEach(el => /* istanbul ignore next */ {
181179
const actualMargin = getStyle(el, 'marginRight') || ''
182180
setAttr(el, 'data-margin-right', actualMargin)
183181
setStyle(el, 'marginRight', `${toFloat(getCS(el).marginRight, 0) + scrollbarWidth}px`)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/bootstrap-vue/bootstrap-vue/commit/b0f5f63369595c57b6c1f1387ff0b8e2f76ed6c9

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy