File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
classes/Visualizer/Module Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -469,6 +469,7 @@ public function renderLibraryPage() {
469
469
array (
470
470
'action ' => Visualizer_Plugin::ACTION_CREATE_CHART ,
471
471
'library ' => 'yes ' ,
472
+ 'type ' => isset ( $ _GET ['type ' ] ) ? $ _GET ['type ' ] : '' ,
472
473
), $ ajaxurl
473
474
),
474
475
'edit ' => add_query_arg (
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ public function renderChartPages() {
211
211
// check chart, if chart not exists, will create new one and redirects to the same page with proper chart id
212
212
$ chart_id = isset ( $ _GET ['chart ' ] ) ? filter_var ( $ _GET ['chart ' ], FILTER_VALIDATE_INT ) : '' ;
213
213
if ( ! $ chart_id || ! ( $ chart = get_post ( $ chart_id ) ) || $ chart ->post_type != Visualizer_Plugin::CPT_VISUALIZER ) {
214
- $ default_type = 'line ' ;
214
+ $ default_type = isset ( $ _GET [ ' type ' ] ) && ! empty ( $ _GET [ ' type ' ] ) ? $ _GET [ ' type ' ] : 'line ' ;
215
215
$ source = new Visualizer_Source_Csv ( VISUALIZER_ABSPATH . DIRECTORY_SEPARATOR . 'samples ' . DIRECTORY_SEPARATOR . $ default_type . '.csv ' );
216
216
$ source ->fetch ();
217
217
$ chart_id = wp_insert_post (
Original file line number Diff line number Diff line change 3
3
/* global alert */
4
4
5
5
( function ( $ ) {
6
+ $ ( window ) . load ( function ( ) {
7
+ // scroll to the selected chart type.
8
+ if ( $ ( 'label.type-label.type-label-selected' ) . length > 0 ) {
9
+ $ ( 'label.type-label.type-label-selected' ) [ 0 ] . scrollIntoView ( ) ;
10
+ }
11
+ } ) ;
12
+
6
13
$ ( document ) . ready ( function ( ) {
7
14
init_permissions ( ) ;
8
15
You can’t perform that action at this time.
0 commit comments