diff --git a/config/plugins/visualizations/charts/static/app.css b/config/plugins/visualizations/charts/static/app.css index 47c5ec0e0664..84e382c521b2 100644 --- a/config/plugins/visualizations/charts/static/app.css +++ b/config/plugins/visualizations/charts/static/app.css @@ -1,6 +1,7 @@ .charts-viewer .ui-message { position: absolute; width: calc(100% - 20px); + z-index: 100; } .charts-tooltip { diff --git a/config/plugins/visualizations/charts/static/app.js b/config/plugins/visualizations/charts/static/app.js index 8d1368a13346..0b56fdda52fc 100644 --- a/config/plugins/visualizations/charts/static/app.js +++ b/config/plugins/visualizations/charts/static/app.js @@ -2,7 +2,7 @@ * Main application class. */ define( [ 'mvc/ui/ui-modal', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils', 'plugin/components/storage', 'plugin/components/model', 'utils/deferred', 'plugin/views/viewer', 'plugin/views/editor', 'plugin/charts/types' ], - function( Modal, Portlet, Ui, Utils, Storage, Chart, Deferred, ViewerView, EditorView, Types ) { + function( Modal, Portlet, Ui, Utils, Storage, Chart, Deferred, Viewer, Editor, Types ) { return Backbone.View.extend({ initialize: function(options){ this.options = options; @@ -13,10 +13,10 @@ define( [ 'mvc/ui/ui-modal', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils this.deferred = new Deferred(); // views - this.viewer_view = new ViewerView( this ); - this.editor_view = new EditorView( this ); - this.$el.append( this.viewer_view.$el ); - this.$el.append( this.editor_view.$el ); + this.viewer = new Viewer( this ); + this.editor = new Editor( this ); + this.$el.append( this.viewer.$el ); + this.$el.append( this.editor.$el ); // pick start screen if ( !this.storage.load() ) { @@ -30,9 +30,9 @@ define( [ 'mvc/ui/ui-modal', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils /** Loads a view and makes sure that all others are hidden */ go: function( view_id ) { $( '.tooltip' ).hide(); - this.viewer_view.hide(); - this.editor_view.hide(); - this[ view_id + '_view' ].show(); + this.viewer.hide(); + this.editor.hide(); + this[ view_id ].show(); }, /** Returns root path */ diff --git a/config/plugins/visualizations/charts/static/views/viewer.js b/config/plugins/visualizations/charts/static/views/viewer.js index f696d3c8e5e3..bbe9c757296e 100644 --- a/config/plugins/visualizations/charts/static/views/viewer.js +++ b/config/plugins/visualizations/charts/static/views/viewer.js @@ -1,13 +1,12 @@ /** This class renders the chart viewer which encapsulates the chart viewport. */ -define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-portlet', - 'plugin/views/viewport', 'plugin/components/screenshot' ], - function( Utils, Ui, Portlet, ViewportView, Screenshot ) { +define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-portlet', 'plugin/views/viewport', 'plugin/components/screenshot' ], + function( Utils, Ui, Portlet, Viewport, Screenshot ) { return Backbone.View.extend({ initialize: function(app, options){ var self = this; this.app = app; this.chart = this.app.chart; - this.viewport_view = new ViewportView( app ); + this.viewport = new Viewport( app ); this.message = new Ui.Message(); // button menu @@ -25,7 +24,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-portlet', onclick : function() { self._wait( self.chart, function() { Screenshot.createPNG({ - $el : self.viewport_view.$el, + $el : self.viewport.$el, title : self.chart.get( 'title' ), error : function( err ) { self.message.update( { message: err, status: 'danger' } ); @@ -43,7 +42,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-portlet', onclick : function() { self._wait( self.chart, function() { Screenshot.createSVG({ - $el : self.viewport_view.$el, + $el : self.viewport.$el, title : self.chart.get( 'title' ), error : function( err ) { self.message.update( { message: err, status: 'danger' } ); @@ -68,7 +67,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-portlet', self.app.modal.hide(); self._wait( self.chart, function() { Screenshot.createPDF({ - $el : self.viewport_view.$el, + $el : self.viewport.$el, title : self.chart.get( 'title' ), error : function( err ) { self.message.update( { message: err, status: 'danger' } ); @@ -103,7 +102,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-portlet', // append elements this.portlet.append( this.message.$el ); - this.portlet.append( this.viewport_view.$el.addClass( 'ui-margin-top' ) ); + this.portlet.append( this.viewport.$el.addClass( 'ui-margin-top' ) ); this.setElement( this.portlet.$el ); // events @@ -128,7 +127,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-portlet', }, /** Check if chart is ready for export */ - _wait: function(chart, callback) { + _wait: function( chart, callback ) { if ( this.app.deferred.ready() ) { callback(); } else {