diff --git a/client/galaxy/scripts/mvc/ui/ui-modal.js b/client/galaxy/scripts/mvc/ui/ui-modal.js index 6bc52fc0f09..73adf7ba8c7 100644 --- a/client/galaxy/scripts/mvc/ui/ui-modal.js +++ b/client/galaxy/scripts/mvc/ui/ui-modal.js @@ -1,5 +1,8 @@ define([], function() { var View = Backbone.View.extend({ + + className: "ui-modal", + // defaults optionsDefault : { container : 'body', @@ -19,18 +22,8 @@ var View = Backbone.View.extend({ // initialize initialize: function( options ) { - this.setElement( this._template() ); this.options = _.defaults( options || {}, this.optionsDefault ); $( this.options.container ).prepend( this.el ); - - // link elements - this.$header = this.$( '.modal-header' ); - this.$dialog = this.$( '.modal-dialog' ); - this.$body = this.$( '.modal-body' ); - this.$footer = this.$( '.modal-footer' ); - this.$backdrop = this.$( '.modal-backdrop' ); - this.$buttons = this.$( '.buttons' ); - // optional render options && this.render(); }, @@ -70,6 +63,16 @@ var View = Backbone.View.extend({ */ render: function() { var self = this; + this.$el.html( this._template() ); + + // link elements + this.$header = this.$( '.modal-header' ); + this.$dialog = this.$( '.modal-dialog' ); + this.$body = this.$( '.modal-body' ); + this.$footer = this.$( '.modal-footer' ); + this.$backdrop = this.$( '.modal-backdrop' ); + this.$buttons = this.$( '.buttons' ); + if (this.options.body == 'progress') { this.options.body = $( '
' + '
' + @@ -164,17 +167,15 @@ var View = Backbone.View.extend({ * Returns the modal template */ _template: function() { - return '
' + - '