I have a bootstrap modification for a tooltip. and process my js with webpack/babel
A simplification of my code could be:
$('[data-toggle="tooltip"]').tooltip({
title: () => {
return $(this).children('.tooltip-html-content').html();
}
});
This should be the element, bootstrap will call this function with:
getTitle: function () {
var title
, $e = this.$element
, o = this.options
title = $e.attr('data-original-title')
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
return title
}
The important line is:
o.title.call($e[0])
Where $e[0] is the tooltip dom element.
Well, when I process this with babel the result change this
by _this
a before he assign _this to a value that he consider is the real this.
The question: Can I avoid this conversion in babel for this specific function?
=====
Final solution based in the response:
getTitle: function getTitle() {