Skip to content

Commit 2aaec76

Browse files
nfriendtmorehouse
authored andcommitted
feat(b-tooltip, b-popover): allow global delay customization (bootstrap-vue#3426)
1 parent ae2040b commit 2aaec76

File tree

6 files changed

+18
-8
lines changed

6 files changed

+18
-8
lines changed

src/components/popover/popover.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export const props = {
3333
return isArray(value) || arrayIncludes(['flip', 'clockwise', 'counterclockwise'], value)
3434
}
3535
},
36+
delay: {
37+
type: [Number, Object, String],
38+
default: () => getComponentConfig(NAME, 'delay')
39+
},
3640
boundary: {
3741
// String: scrollParent, window, or viewport
3842
// Element: element reference

src/components/tooltip/tooltip.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export default Vue.extend({
3333
return isArray(value) || arrayIncludes(['flip', 'clockwise', 'counterclockwise'], value)
3434
}
3535
},
36+
delay: {
37+
type: [Number, Object, String],
38+
default: () => getComponentConfig(NAME, 'delay')
39+
},
3640
boundary: {
3741
// String: scrollParent, window, or viewport
3842
// Element: element reference

src/directives/popover/popover.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ const validTriggers = {
2222
/* istanbul ignore next: not easy to test */
2323
const parseBindings = bindings => /* istanbul ignore next: not easy to test */ {
2424
// We start out with a basic config
25+
const NAME = 'BPopover'
2526
let config = {
26-
boundary: String(getComponentConfig('BPopover', 'boundary')),
27-
boundaryPadding: parseInt(getComponentConfig('BPopover', 'boundaryPadding'), 10) || 0
27+
delay: getComponentConfig(NAME, 'delay'),
28+
boundary: String(getComponentConfig(NAME, 'boundary')),
29+
boundaryPadding: parseInt(getComponentConfig(NAME, 'boundaryPadding'), 10) || 0
2830
}
2931

3032
// Process bindings.value

src/directives/tooltip/tooltip.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ const validTriggers = {
2222
/* istanbul ignore next: not easy to test */
2323
const parseBindings = bindings => /* istanbul ignore next: not easy to test */ {
2424
// We start out with a basic config
25+
const NAME = 'BTooltip'
2526
let config = {
26-
boundary: String(getComponentConfig('BTooltip', 'boundary')),
27-
boundaryPadding: parseInt(getComponentConfig('BTooltip', 'boundaryPadding'), 10) || 0
27+
delay: getComponentConfig(NAME, 'delay'),
28+
boundary: String(getComponentConfig(NAME, 'boundary')),
29+
boundaryPadding: parseInt(getComponentConfig(NAME, 'boundaryPadding'), 10) || 0
2830
}
2931

3032
// Process bindings.value

src/mixins/toolpop.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ export default {
4242
type: [String, Object, HTMLElement, Function]
4343
// default: undefined
4444
},
45-
delay: {
46-
type: [Number, Object, String],
47-
default: 0
48-
},
4945
offset: {
5046
type: [Number, String],
5147
default: 0

src/utils/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,12 @@ const DEFAULTS = {
144144
role: null
145145
},
146146
BTooltip: {
147+
delay: 0,
147148
boundary: 'scrollParent',
148149
boundaryPadding: 5
149150
},
150151
BPopover: {
152+
delay: 0,
151153
boundary: 'scrollParent',
152154
boundaryPadding: 5
153155
}

0 commit comments

Comments
 (0)