Skip to content

Commit

Permalink
fixed clearing content on-refresh for file-type-widget
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobzlee committed Nov 6, 2015
1 parent 27ad0d2 commit 326a942
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions demail/js/newman-file-type-attach.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
*/
var newman_file_type_attach = (function () {

var chart_bar_ui_id = '#chart_horizontal_bar_attach_types';
var chart_donut_ui_id = '#chart_donut_attach_types';

var _donut_chart_file_type_attach;

var _top_count, _top_count_max = 10;
Expand All @@ -17,9 +20,6 @@ var newman_file_type_attach = (function () {
*/
function displayUIFileTypeAttach( count ) {

var chart_bar_ui_id = '#chart_horizontal_bar_attach_types';
var chart_donut_ui_id = '#chart_donut_attach_types';

if (chart_bar_ui_id) {

_top_count = count;
Expand All @@ -37,11 +37,8 @@ var newman_file_type_attach = (function () {
*/
function updateUIFileTypeAttach( response ) {

var chart_bar_ui_id = '#chart_horizontal_bar_attach_types';
var chart_donut_ui_id = '#chart_donut_attach_types';

if (response && chart_bar_ui_id) {
$(chart_bar_ui_id).empty();
initUI();

//console.log('\tfiltered_response: ' + JSON.stringify(response, null, 2));
var data_set_id = response.data_set_id;
Expand Down Expand Up @@ -167,7 +164,13 @@ var newman_file_type_attach = (function () {
}

function initUI() {
if (chart_bar_ui_id) {
$(chart_bar_ui_id).empty();
}

if (chart_donut_ui_id) {
$(chart_donut_ui_id).empty();
}

}

Expand Down

0 comments on commit 326a942

Please sign in to comment.