Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Giehl <stefan@piwik.org>2018-05-01 18:09:40 +0300
committerBenaka <diosmosis@users.noreply.github.com>2018-05-01 18:09:40 +0300
commit9eff672aae8e0289190757f4b47dd5627df00fd2 (patch)
tree56119444b9d38ffd45d99bf9e09601cdbffb1f63 /plugins/CoreHome/angularjs/widget/widget.directive.js
parent0e7f6e24ad104f653876f9d4680071b1a258debe (diff)
Automatically initialize title tooltips after loading a report (#12800)
* Automatically initialize title tooltips after loading a report * destroy tooltips upon scope destroy * avoid tooltip
Diffstat (limited to 'plugins/CoreHome/angularjs/widget/widget.directive.js')
-rw-r--r--plugins/CoreHome/angularjs/widget/widget.directive.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/CoreHome/angularjs/widget/widget.directive.js b/plugins/CoreHome/angularjs/widget/widget.directive.js
index 8f2bd2e25d..45a12031a0 100644
--- a/plugins/CoreHome/angularjs/widget/widget.directive.js
+++ b/plugins/CoreHome/angularjs/widget/widget.directive.js
@@ -96,6 +96,25 @@
} else if (attrs.containerid) {
findContainerWidget(attrs.containerid, scope);
}
+
+ $(element).tooltip({
+ track: true,
+ content: function() {
+ var title = $(this).attr('title');
+ return piwikHelper.escape(title.replace(/\n/g, '<br />'));
+ },
+ show: false,
+ hide: false
+ });
+
+ scope.$on(
+ "$destroy",
+ function () {
+ try {
+ $(element).tooltip('destroy');
+ } catch (e) {}
+ }
+ );
}
}
};