mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Remove unused class variables, reduce indention
This commit is contained in:
@@ -3,33 +3,30 @@ define([], function() {
|
||||
/** Frame view */
|
||||
var FrameView = Backbone.View.extend({
|
||||
initialize: function( options ) {
|
||||
var self = this;
|
||||
this.setElement( $( '<div/>' ).addClass( 'corner' ).addClass( 'frame' ) );
|
||||
this.$el.append( this.$header = $( '<div/>' ).addClass( 'f-header corner' )
|
||||
.append( this.$title = $( '<div/>' ).addClass( 'f-title' ).html( options.title || '' ) )
|
||||
.append( this.$close = $( '<div/>' ).addClass( 'f-icon f-close fa fa-close' )
|
||||
.tooltip( { title: 'Close', placement: 'bottom' } ) ) )
|
||||
.append( this.$content = $( '<div/>' ).addClass( 'f-content' ) )
|
||||
.append( this.$resize = $( '<div/>' ).addClass( 'f-resize f-icon corner fa fa-expand' ).tooltip( { title: 'Resize' } ) )
|
||||
.append( this.$cover = $( '<div/>' ).addClass( 'f-cover' ) );
|
||||
|
||||
// configure content
|
||||
this.setElement( $( '<div/>' ).addClass( 'corner frame' ) );
|
||||
this.$el.append( $( '<div/>' ).addClass( 'f-header corner' )
|
||||
.append( $( '<div/>' ).addClass( 'f-title' ).html( options.title || '' ) )
|
||||
.append( $( '<div/>' ).addClass( 'f-icon f-close fa fa-close' )
|
||||
.tooltip( { title: 'Close', placement: 'bottom' } ) ) )
|
||||
.append( $( '<div/>' ).addClass( 'f-content' ) )
|
||||
.append( $( '<div/>' ).addClass( 'f-resize f-icon corner fa fa-expand' ).tooltip( { title: 'Resize' } ) )
|
||||
.append( $( '<div/>' ).addClass( 'f-cover' ) );
|
||||
var $header = this.$( '.f-header' );
|
||||
var $content = this.$( '.f-content' );
|
||||
_.each( options.menu, function( option ) {
|
||||
self.$header.append( $( '<div/>' ).addClass( 'f-icon-left' )
|
||||
.addClass( option.icon )
|
||||
.tooltip( { title: option.tooltip, placement: 'bottom' } )
|
||||
.on( 'click', function() { option.onclick( self.$content ) } ) );
|
||||
$header.append( $( '<div/>' ).addClass( 'f-icon-left' )
|
||||
.addClass( option.icon )
|
||||
.tooltip( { title: option.tooltip, placement: 'bottom' } )
|
||||
.on( 'click', function() { option.onclick( $content ) } ) );
|
||||
} );
|
||||
|
||||
// configure content
|
||||
if ( options.url ) {
|
||||
this.$content.append(
|
||||
$content.html(
|
||||
$ ( '<iframe/>' ).addClass( 'f-iframe' )
|
||||
.attr( 'scrolling', 'auto' )
|
||||
.attr( 'src', options.url + ( options.url.indexOf( '?' ) === -1 ? '?' : '&' ) + 'widget=True' )
|
||||
);
|
||||
} else if ( options.content ) {
|
||||
_.isFunction( options.content ) ? options.content( this.$content ) : this.$content.append( options.content );
|
||||
_.isFunction( options.content ) ? options.content( $content ) : $content.html( options.content );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user