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:
Diffstat (limited to 'plugins/CustomDimensions/javascripts/rowactions.js')
m---------plugins/CustomDimensions0
-rw-r--r--plugins/CustomDimensions/javascripts/rowactions.js66
2 files changed, 66 insertions, 0 deletions
diff --git a/plugins/CustomDimensions b/plugins/CustomDimensions
deleted file mode 160000
-Subproject 318661a2fb1ef3b3e5d6d999ae8b9628cb5a113
diff --git a/plugins/CustomDimensions/javascripts/rowactions.js b/plugins/CustomDimensions/javascripts/rowactions.js
new file mode 100644
index 0000000000..34c428d840
--- /dev/null
+++ b/plugins/CustomDimensions/javascripts/rowactions.js
@@ -0,0 +1,66 @@
+$(function () {
+
+ function isActionCustomDimensionReport(params) {
+ return params.module == 'CustomDimensions'
+ && params.action == 'getCustomDimension'
+ && params.scopeOfDimension
+ && params.scopeOfDimension === 'action';
+ }
+
+ if (window.DataTable_RowActions_Transitions) {
+ DataTable_RowActions_Transitions.registerReport({
+ isAvailableOnReport: function (dataTableParams) {
+ return isActionCustomDimensionReport(dataTableParams);
+ },
+ isAvailableOnRow: function (dataTableParams, tr) {
+ return isActionCustomDimensionReport(dataTableParams) && tr.parents('table').first().hasClass('subDataTable');
+ },
+ trigger: function (tr, e, subTableLabel) {
+ var label = this.getLabelFromTr(tr);
+ if (label && label.substr(0, 1) === '@') {
+ label = label.substr(1);
+ }
+
+ var subtable = tr.closest('table');
+ if (subtable.is('.subDataTable')) {
+ var prev = subtable.closest('tr').prev();
+ var segment = prev.attr('data-segment-filter');
+ if (segment) {
+ label = unescape(label);
+ DataTable_RowActions_Transitions.launchForUrl(label, segment);
+ }
+ }
+ }
+ });
+ }
+
+ if (window.DataTable_RowActions_Overlay) {
+ DataTable_RowActions_Overlay.registerReport({
+ isAvailableOnReport: function (dataTableParams) {
+ return isActionCustomDimensionReport(dataTableParams);
+ },
+ onClick: function (actionA, tr, e) {
+ var segment;
+ var link = this.getLabelFromTr(tr);
+ if (link && link.substr(0, 1) === '@') {
+ link = link.substr(1);
+ }
+
+ link = 'http://' + unescape(link);
+
+ var subtable = tr.closest('table');
+ if (subtable.is('.subDataTable')) {
+ var prev = subtable.closest('tr').prev();
+ segment = prev.attr('data-segment-filter');
+ }
+
+ return {
+ link: link,
+ segment: segment
+ }
+ }
+ });
+ }
+
+
+});