diff options
author | sgiehl <stefan@piwik.org> | 2016-07-15 01:31:54 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2016-07-15 01:31:54 +0300 |
commit | 736d0086d2d041d0a7d234f41732cdb385102549 (patch) | |
tree | 06c728da1580f8b1e5fa7356a9bcc35a63bce4ec /plugins/SegmentEditor/javascripts | |
parent | 96f289b0a679b36867e4b5a5b7fed70b8132a2a6 (diff) |
add option to hide segment definition change confirm
Diffstat (limited to 'plugins/SegmentEditor/javascripts')
-rw-r--r-- | plugins/SegmentEditor/javascripts/Segmentation.js | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/plugins/SegmentEditor/javascripts/Segmentation.js b/plugins/SegmentEditor/javascripts/Segmentation.js index 609368def7..7365a89fd6 100644 --- a/plugins/SegmentEditor/javascripts/Segmentation.js +++ b/plugins/SegmentEditor/javascripts/Segmentation.js @@ -1076,7 +1076,7 @@ Segmentation = (function($) { "idSegment": segmentId }); - if(segmentStr != getSegmentFromId(segmentId).definition) { + if(segmentStr != getSegmentFromId(segmentId).definition && $('.segment-definition-change-confirm').data('hideMessage') != 1) { var segmentProcessedOnRequest = $('.segment-definition-change-confirm').data('segmentProcessedOnRequest'); $('.process-on-request, .no-process-on-request').hide(); @@ -1089,7 +1089,25 @@ Segmentation = (function($) { piwikHelper.modalConfirm('.segment-definition-change-confirm', { yes: function () { - self.updateMethod(params); + if ($('#hideSegmentMessage:checked').length) { + var ajaxHandler = new ajaxHelper(); + ajaxHandler.setLoadingElement(); + ajaxHandler.addParams({ + "module": 'API', + "format": 'json', + "method": 'UsersManager.setUserPreference', + "userLogin": piwik.userLogin, + "preferenceName": "hideSegmentDefinitionChangeMessage", + "preferenceValue": "1" + }, 'GET'); + ajaxHandler.useCallbackInCaseOfError(); + ajaxHandler.setCallback(function (response) { + self.updateMethod(params); + }); + ajaxHandler.send(true); + } else { + self.updateMethod(params); + } } }); } else { |