Skip to content

Commit

Permalink
Improving handling of downsample, smoothing options when loading the …
Browse files Browse the repository at this point in the history
…action menu
  • Loading branch information
Mark Troyer committed Jul 31, 2014
1 parent cb898d2 commit 3f65b6e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/Widgets/OpenTSDBWidget/js/sw.opentsdbwidget.js
Expand Up @@ -454,15 +454,19 @@
max: 10
});
$('div#change-downsample').css('margin-right', '20px').children('span.ui-slider-handle').text('|||');
if (typeof widget.graph.master_ds_multiplier !== "undefined") {
$('div#change-downsample').slider('value', widget.graph.master_ds_multiplier);
}
},
afterClose: function() {
$('#downsample-popup').remove();
}
}
});
$('#change-downsample').on('slidechange', function() {
widget.graph.master_ds_multiplier = $('#change-downsample').slider('value');
$.each(widget.query_data.metrics, function(key, values) {
values.ds_multiplier = $('#change-downsample').slider('value');
values.ds_multiplier = widget.graph.master_ds_multiplier;
});
widget.resize_graph();
});
Expand Down Expand Up @@ -1716,6 +1720,12 @@

if ($('#smoothing-button' + widget_num + '-1').prop('checked')) {
build_metric.smoothing = true;
var options_sub_menu = widget.sw_opentsdbwidget_action
.children('ul#widget-action-main')
.children('li#widget-action-options-menu')
.children('ul#widget-action-options');
options_sub_menu.children('li[data-menu-action="apply_smoothing"]').addClass('nodisplay');
options_sub_menu.children('li[data-menu-action="disable_smoothing"]').removeClass('nodisplay');
}

var search_key = md5(JSON.stringify(build_metric));
Expand Down

0 comments on commit 3f65b6e

Please sign in to comment.