element.classList.remove('jsTooltip');
var title = element.getAttribute('title');
+ title = (typeof title === 'string') ? title.trim() : '';
+
if (title.length) {
element.setAttribute('data-tooltip', title);
element.removeAttribute('title');
_mouseEnter: function(event) {
var element = event.currentTarget;
var title = element.getAttribute('title');
- if (typeof title === 'string' && title !== '') {
+ title = (typeof title === 'string') ? title.trim() : '';
+
+ if (title !== '') {
element.setAttribute('data-tooltip', title);
element.removeAttribute('title');
}