Skip to content

Commit

Permalink
Fix message style, align view names
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Aug 22, 2016
1 parent 7325991 commit 76d886e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
1 change: 1 addition & 0 deletions 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 {
Expand Down
16 changes: 8 additions & 8 deletions config/plugins/visualizations/charts/static/app.js
Expand Up @@ -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;
Expand All @@ -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() ) {
Expand All @@ -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 */
Expand Down
17 changes: 8 additions & 9 deletions 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
Expand All @@ -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' } );
Expand All @@ -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' } );
Expand All @@ -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' } );
Expand Down Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 76d886e

Please sign in to comment.