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/SegmentEditor/templates/Segmentation.js')
-rw-r--r--plugins/SegmentEditor/templates/Segmentation.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/SegmentEditor/templates/Segmentation.js b/plugins/SegmentEditor/templates/Segmentation.js
index b0993e36c0..7ca9ebdffc 100644
--- a/plugins/SegmentEditor/templates/Segmentation.js
+++ b/plugins/SegmentEditor/templates/Segmentation.js
@@ -398,6 +398,7 @@ Segmentation = (function($) {
segment.definition = $(this).data("definition");
segment.name = $(this).attr("title");
self.segmentSelectMethod( segment.definition );
+ toggleLoadingMessage( segment.definition.length );
setSegment(segment.definition);
markCurrentSegment();
}
@@ -955,6 +956,14 @@ Segmentation = (function($) {
$(selector).css({left: Math.max($('#periodString')[0].offsetWidth) + 10});
}
+ function toggleLoadingMessage(segmentIsSet) {
+ if (segmentIsSet) {
+ $('#ajaxLoading .loadingSegment').show();
+ } else {
+ $('#ajaxLoading .loadingSegment').hide();
+ }
+ }
+
var initHtml = function() {
if(typeof self.content !== "undefined"){
self.content.unbind();
@@ -972,6 +981,10 @@ Segmentation = (function($) {
// assign content to object attribute to make it easil accesible through all widget methods
bindListEvents();
markCurrentSegment();
+
+ // Loading message
+ var segmentIsSet = self.getSegment().length;
+ toggleLoadingMessage(segmentIsSet);
}
initHtml();
};
@@ -990,9 +1003,6 @@ $(document).ready( function(){
$('#segmentEditorPanel a.close').click();
segmentDefinition = cleanupSegmentDefinition(segmentDefinition);
segmentDefinition = encodeURIComponent(segmentDefinition);
- if(segmentDefinition.length) {
- $('.loadingSegment').show();
- }
return broadcast.propagateNewPage('segment=' + segmentDefinition, true);
};