This commit is contained in:
Daniel Camargo 2013-06-21 18:54:26 -03:00
parent 702762a4ea
commit eb1e2ef096
3 changed files with 8 additions and 6 deletions

View File

@ -51,7 +51,7 @@ class Controller_home extends Crunchbutton_Controller_Account {
),
'Tracking Marketing Efforts' => array(
'active-users-per-week' => 'Active Users per Week',
'active-users-by-community' => 'Active users by community',
'active-users-per-week-by-community' => 'Active Users per Week by Community',
'orders-by-weekday-by-community' => 'Orders by Weekday by Community',
'orders-per-week' => 'Orders per Week',
'orders-per-week-by-community' => 'Orders per Week by Community',

View File

@ -87,7 +87,7 @@
Weeks from <?php echo $from; ?> to <?php echo $to; ?> (of <?php echo $totalWeeks; ?>):
</div>
<div class="span8">
<div id="slider-<?=$chartId?>-<?php echo $number; ?>"></div>
<div id="slider-<?=$chartId?>-<?php echo $number; ?>" data-from="<?php echo $from; ?>" data-to="<?php echo $to; ?>"></div>
</div>
</div>
<hr />

View File

@ -229,7 +229,6 @@
}
} );
} );
} );
function loadChart( chartId ){
@ -238,14 +237,17 @@
var title = chart.attr( 'data-title' );
var id = chart.attr( 'data-id' );
var count = chart.attr( 'data-count' );
var sliderValues = '';
if( chart.attr( 'opened' ) ){
$( '#week-' + chartId ).html( '<i class="icon-spinner icon-spin"></i>' );
$( '#slider-' + chartId ).slider( 'disable' );
$( '#slider-' + chartId ).css( 'opacity', 0.4 );
var slider = $( '#slider-' + chartId );
slider.slider( 'disable' );
slider.css( 'opacity', 0.4 );
sliderValues = '&to=' + slider.attr( 'data-to' ) + '&from=' + slider.attr( 'data-from' );
}
chart.attr( 'opened', true );
var activeUserDays = $( '#active-user-days' ).val();
var url = '/home/charts/' + id + '/' + title + '/' + count + '?activeUserDays=' + activeUserDays;
var url = '/home/charts/' + id + '/' + title + '/' + count + '?activeUserDays=' + activeUserDays + sliderValues;
$.ajax( { url: url, }).done( function( data ) { chart.html( data ); } );
}
</script>