| @@ -42,16 +42,9 @@ | ||
| 42 | 42 | margin = width * 0.02; |
| 43 | 43 | |
| 44 | 44 | width *= 0.305; |
| 45 | 45 | $(this).prev( '.visualizer-chart-title' ).width(width - 14); |
| 46 | - var ChartHeight = width * 0.93; | |
| 47 | - if ( $( '.visualizer-nochart-canvas' ).length === 0 ) { | |
| 48 | - ChartHeight = width * 0.78; | |
| 49 | - if ( $( '#visualizer-sidebar' ).hasClass('one-columns') ) { | |
| 50 | - ChartHeight = width * 0.92; | |
| 51 | - } | |
| 52 | - } | |
| 53 | - $(this).width(width).height( ChartHeight ); | |
| 46 | + $(this).width(width - 14).height(width * 0.75).parent().css('margin-right', margin + 'px').css('margin-bottom', margin + 'px'); | |
| 54 | 47 | }); |
| 55 | 48 | }; |
| 56 | 49 | |
| 57 | 50 | $('.visualizer-chart-canvas').adjust(); |
| @@ -91,22 +84,11 @@ | ||
| 91 | 84 | range.select(); |
| 92 | 85 | } |
| 93 | 86 | }); |
| 94 | 87 | |
| 95 | - $( '.visualizer-languages-list' ).on( 'click', '[data-lang_code]', function() { | |
| 96 | - if ( $(this).find( 'i' ).hasClass( 'otgs-ico-add' ) ) { | |
| 97 | - vu.create = vu.create + '&lang=' + $(this).data('lang_code') + '&parent_chart_id=' + $(this).data('chart'); | |
| 98 | - $('.add-new-chart').click(); | |
| 99 | - } else { | |
| 100 | - vu.edit = vu.edit + '&lang=' + $(this).data('lang_code') + '&chart=' + $(this).data('chart'); | |
| 101 | - $('.visualizer-chart-edit').click(); | |
| 102 | - } | |
| 103 | - } ); | |
| 104 | - | |
| 105 | 88 | $('.add-new-chart').click(function () { |
| 106 | 89 | var wnd = window, |
| 107 | 90 | view = new vmv.Chart({action: vu.create}); |
| 108 | - vu.create = vu.create.replace(/[\?&]lang=[^&]+/, '').replace(/[\?&]parent_chart_id=[^&]+/, ''); | |
| 109 | 91 | |
| 110 | 92 | window.parent.addEventListener('message', function(event){ |
| 111 | 93 | switch(event.data) { |
| 112 | 94 | case 'visualizer:mediaframe:close': |
| @@ -126,13 +108,10 @@ | ||
| 126 | 108 | return false; |
| 127 | 109 | }); |
| 128 | 110 | |
| 129 | 111 | $('.visualizer-chart-edit').click(function () { |
| 130 | - var wnd = window; | |
| 131 | - var view = new vmv.Chart( { | |
| 132 | - action: vu.edit.indexOf('&chart') != -1 ? vu.edit : vu.edit + '&chart=' + $(this).attr('data-chart') | |
| 133 | - } ); | |
| 134 | - vu.edit = vu.edit.replace(/[\?&]lang=[^&]+/, ''); | |
| 112 | + var wnd = window, | |
| 113 | + view = new vmv.Chart({action: vu.edit + '&chart=' + $(this).attr('data-chart')}); | |
| 135 | 114 | |
| 136 | 115 | wnd.send_to_editor = function () { |
| 137 | 116 | wnd.location.href = wnd.location.href.replace(/vaction/, ''); |
| 138 | 117 | }; |