mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
@@ -25,9 +25,9 @@ kit.PluginManager.register('tooltip',function(module, exports, require){
|
||||
*/
|
||||
|
||||
const NAME = 'tooltip'
|
||||
const DATA_KEY = 'kit.tooltip'
|
||||
const DATA_KEY = 'bs.tooltip'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const CLASS_PREFIX = 'kit-tooltip'
|
||||
const CLASS_PREFIX = 'bs-tooltip'
|
||||
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g')
|
||||
const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn'])
|
||||
|
||||
@@ -62,7 +62,7 @@ kit.PluginManager.register('tooltip',function(module, exports, require){
|
||||
const Default = {
|
||||
animation: true,
|
||||
template: '<div class="tooltip" role="tooltip">' +
|
||||
'<div class="tooltip-arrow"></div>' +
|
||||
'<div class="tooltip-arrow" data-popper-arrow="true"></div>' +
|
||||
'<div class="tooltip-inner"></div>' +
|
||||
'</div>',
|
||||
trigger: 'hover focus',
|
||||
@@ -76,7 +76,7 @@ kit.PluginManager.register('tooltip',function(module, exports, require){
|
||||
fallbackPlacements: ['top', 'right', 'bottom', 'left'],
|
||||
boundary: 'clippingParents',
|
||||
customClass: '',
|
||||
sanitize: true,
|
||||
sanitize: false,
|
||||
sanitizeFn: null,
|
||||
allowList: DefaultAllowlist,
|
||||
popperConfig: null
|
||||
@@ -115,6 +115,7 @@ kit.PluginManager.register('tooltip',function(module, exports, require){
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @class kitTooltip */
|
||||
class Tooltip extends BaseComponent {
|
||||
constructor(element, config) {
|
||||
if (typeof Popper === 'undefined') {
|
||||
@@ -405,7 +406,7 @@ kit.PluginManager.register('tooltip',function(module, exports, require){
|
||||
}
|
||||
|
||||
getTitle() {
|
||||
let title = this._element.getAttribute('data-kit-original-title')
|
||||
let title = this._element.getAttribute('data-bs-original-title')
|
||||
|
||||
if (!title) {
|
||||
title = typeof this._config.title === 'function' ?
|
||||
@@ -552,10 +553,10 @@ kit.PluginManager.register('tooltip',function(module, exports, require){
|
||||
|
||||
_fixTitle() {
|
||||
const title = this._element.getAttribute('title')
|
||||
const originalTitleType = typeof this._element.getAttribute('data-kit-original-title')
|
||||
const originalTitleType = typeof this._element.getAttribute('data-bs-original-title')
|
||||
|
||||
if (title || originalTitleType !== 'string') {
|
||||
this._element.setAttribute('data-kit-original-title', title || '')
|
||||
this._element.setAttribute('data-bs-original-title', title || '')
|
||||
if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {
|
||||
this._element.setAttribute('aria-label', title)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user