| @@ -23,26 +23,13 @@ | ||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | function showTextEditor(button) { |
| 26 | 26 | if( button.attr( 'data-current' ) === 'chart'){ |
| 27 | - | |
| 28 | - $('body').off('visualizer:change:action').on('visualizer:change:action', function(e){ | |
| 29 | - button.val( button.attr( 'data-t-chart' ) ); | |
| 30 | - button.html( button.attr( 'data-t-chart' ) ); | |
| 31 | - button.attr( 'data-current', 'chart' ); | |
| 32 | - $('p.viz-editor-selection').show(); | |
| 33 | - $('p.viz-info-msg').hide(); | |
| 34 | - $('.viz-text-editor').hide(); | |
| 35 | - $('.viz-simple-editor').hide(); | |
| 36 | - $( '#canvas' ).css('z-index', '1').show(); | |
| 37 | - }); | |
| 38 | - | |
| 39 | 27 | // showing the editor |
| 40 | 28 | button.val( button.attr( 'data-t-editor' ) ); |
| 41 | 29 | button.html( button.attr( 'data-t-editor' ) ); |
| 42 | 30 | button.attr( 'data-current', 'editor' ); |
| 43 | 31 | $('p.viz-editor-selection').hide(); |
| 44 | - $('p.viz-info-msg').show(); | |
| 45 | 32 | $('.viz-text-editor').css('z-index', '9999').show(); |
| 46 | 33 | $('.viz-simple-editor').css('z-index', '9999').show(); |
| 47 | 34 | $( '#canvas' ).css('z-index', '-100').hide(); |
| 48 | 35 | }else{ |
| @@ -54,9 +41,8 @@ | ||
| 54 | 41 | button.val( button.attr( 'data-t-chart' ) ); |
| 55 | 42 | button.html( button.attr( 'data-t-chart' ) ); |
| 56 | 43 | button.attr( 'data-current', 'chart' ); |
| 57 | 44 | $('p.viz-editor-selection').show(); |
| 58 | - $('p.viz-info-msg').hide(); | |
| 59 | 45 | $('.viz-text-editor').hide(); |
| 60 | 46 | $('.viz-simple-editor').hide(); |
| 61 | 47 | $( '#canvas' ).css('z-index', '1').show(); |
| 62 | 48 | } |
| @@ -70,26 +56,13 @@ | ||
| 70 | 56 | } |
| 71 | 57 | |
| 72 | 58 | function showTableEditor(button) { |
| 73 | 59 | if( button.attr( 'data-current' ) === 'chart'){ |
| 74 | - | |
| 75 | - $('body').off('visualizer:change:action').on('visualizer:change:action', function(e){ | |
| 76 | - button.val( button.attr( 'data-t-chart' ) ); | |
| 77 | - button.html( button.attr( 'data-t-chart' ) ); | |
| 78 | - button.attr( 'data-current', 'chart' ); | |
| 79 | - $('p.viz-editor-selection').show(); | |
| 80 | - $('p.viz-info-msg').hide(); | |
| 81 | - $('.viz-table-editor').hide(); | |
| 82 | - $('.viz-simple-editor').hide(); | |
| 83 | - $( '#canvas' ).css('z-index', '1').show(); | |
| 84 | - }); | |
| 85 | - | |
| 86 | 60 | // showing the editor |
| 87 | 61 | button.val( button.attr( 'data-t-editor' ) ); |
| 88 | 62 | button.html( button.attr( 'data-t-editor' ) ); |
| 89 | 63 | button.attr( 'data-current', 'editor' ); |
| 90 | 64 | $('p.viz-editor-selection').hide(); |
| 91 | - $('p.viz-info-msg').show(); | |
| 92 | 65 | $( '.viz-table-editor' ).css("z-index", "9999").show(); |
| 93 | 66 | $('.viz-simple-editor').css('z-index', '9999').show(); |
| 94 | 67 | $('body').trigger('visualizer:db:editor:table:redraw', {}); |
| 95 | 68 | $( '#canvas' ).css("z-index", "-100").hide(); |
| @@ -94,9 +67,8 @@ | ||
| 94 | 67 | $('body').trigger('visualizer:db:editor:table:redraw', {}); |
| 95 | 68 | $( '#canvas' ).css("z-index", "-100").hide(); |
| 96 | 69 | }else{ |
| 97 | 70 | $('#canvas').lock(); |
| 98 | - jQuery('.dataTables_scrollBody .sorting_disabled input').attr('disabled', true); | |
| 99 | 71 | $('#table-editor-form').submit(); |
| 100 | 72 | |
| 101 | 73 | // showing the chart |
| 102 | 74 | button.val( button.attr( 'data-t-chart' ) ); |
| @@ -102,9 +74,8 @@ | ||
| 102 | 74 | button.val( button.attr( 'data-t-chart' ) ); |
| 103 | 75 | button.html( button.attr( 'data-t-chart' ) ); |
| 104 | 76 | button.attr( 'data-current', 'chart' ); |
| 105 | 77 | $('p.viz-editor-selection').show(); |
| 106 | - $('p.viz-info-msg').hide(); | |
| 107 | 78 | $('.viz-table-editor').hide(); |
| 108 | 79 | $('.viz-simple-editor').hide(); |
| 109 | 80 | $( '#canvas' ).css('z-index', '1').show(); |
| 110 | 81 | } |