Permalink
Browse files

fix(tolltip+popover): Hide original element title attribute (#970)

Addresses issue #955
  • Loading branch information...
tmorehouse committed Aug 31, 2017
1 parent da45a3e commit 82e46e64ce8ddc9a72ac6242b9a82cca392f2585
Showing with 10 additions and 5 deletions.
  1. +10 −5 lib/classes/tooltip.js
@@ -151,7 +151,10 @@ class ToolTip {
if (config.content && typeof config.content === 'number') {
updatedConfig.content = config.content.toString();
}
// Hide element original title if needed
this.fixTitle();
// Update the config
this.$config = updatedConfig;
// Stop/Restart listening
this.unListen();
@@ -210,6 +213,7 @@ class ToolTip {
// Build tooltip element (also sets this.$tip)
const tip = this.getTipElement();
this.fixTitle();
this.setContent(tip);
if (!this.isWithContent(tip)) {
// if No content, dont bother showing
@@ -611,10 +615,11 @@ class ToolTip {
}
fixTitle() {
const titleType = typeof this.$element.getAttribute('data-original-title');
if (this.$element.getAttribute('title') || titleType !== 'string') {
this.$element.setAttribute('data-original-title', this.$element.getAttribute('title') || '');
this.$element.setAttribute('title', '');
const el = this.$element;
const titleType = typeof el.getAttribute('data-original-title');
if (el.getAttribute('title') || titleType !== 'string') {
el.setAttribute('data-original-title', el.getAttribute('title') || '');
el.setAttribute('title', '');
}
}

0 comments on commit 82e46e6

Please sign in to comment.