2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/454638eb2434/ changeset: 454638eb2434 user: carlfeberhard date: 2012-12-18 19:53:55 summary: history panel: fix to js behaviors on late-rendered hda bodies affected #: 2 files diff -r c961f5647673a8cbe5f0f7275b82513e2067afc9 -r 454638eb2434c827350b2c8dadbc04760ffa11b6 static/scripts/mvc/dataset/hda-base.js --- a/static/scripts/mvc/dataset/hda-base.js +++ b/static/scripts/mvc/dataset/hda-base.js @@ -78,16 +78,12 @@ itemWrapper.append( this._render_warnings() ); itemWrapper.append( this._render_titleBar() ); + //NOTE: only sets behaviors on title and warnings - body will set up it's own + this._setUpBehaviors( itemWrapper ); + this.body = $( this._render_body() ); itemWrapper.append( this.body ); - //TODO: move to own function: setUpBehaviours - // we can potentially skip this step and call popupmenu directly on the download button - make_popup_menus( itemWrapper ); - - // set up canned behavior on children (bootstrap, popupmenus, editable_text, etc.) - itemWrapper.find( '.tooltip' ).tooltip({ placement : 'bottom' }); - // transition... this.$el.fadeOut( 'fast', function(){ view.$el.children().remove(); @@ -155,6 +151,17 @@ }); }, + /** set up js behaviors, event handlers for elements within the given container + * @param {jQuery} $container jq object that contains the elements to process (defaults to this.$el) + */ + _setUpBehaviors : function( $container ){ + $container = $container || this.$el; + // set up canned behavior on children (bootstrap, popupmenus, editable_text, etc.) + //TODO: we can potentially skip this step and call popupmenu directly on the download button + make_popup_menus( $container ); + $container.find( '.tooltip' ).tooltip({ placement : 'bottom' }); + }, + // ................................................................................ RENDER titlebar /** Render any hda warnings including: is deleted, is purged, is hidden. * (including links to further actions (undelete, etc.)) @@ -389,6 +396,7 @@ body.append( $( '<div>Error: unknown dataset state "' + this.model.get( 'state' ) + '".</div>' ) ); } body.append( '<div style="clear: both"></div>' ); + this._setUpBehaviors( body ); }, /** Render inaccessible, not-owned by curr user. diff -r c961f5647673a8cbe5f0f7275b82513e2067afc9 -r 454638eb2434c827350b2c8dadbc04760ffa11b6 static/scripts/mvc/dataset/hda-model.js --- a/static/scripts/mvc/dataset/hda-model.js +++ b/static/scripts/mvc/dataset/hda-model.js @@ -220,7 +220,15 @@ * @returns array of encoded ids */ ids : function(){ - return this.map( function( item ){ return item.id; }); + return this.map( function( hda ){ return hda.id; }); + }, + + /** Get the hda with the given hid + * @param {Int} hid the hid to search for + * @returns {HistoryDatasetAssociation} the hda with the given hid or undefined if not found + */ + getByHid : function( hid ){ + return _.first( this.filter( function( hda ){ return hda.get( 'hid' ) === hid; }) ); }, /** If the given hid is in the collection, return it's index. If not, return the insertion point it would need. https://bitbucket.org/galaxy/galaxy-central/changeset/eb3962726462/ changeset: eb3962726462 user: carlfeberhard date: 2012-12-18 20:37:54 summary: merge staging:454638eb2434 to central affected #: 2 files diff -r 715063d652abc9dc3197617012763284143e7ab2 -r eb39627264622db4805927d0d0f35972067a58b7 static/scripts/mvc/dataset/hda-base.js --- a/static/scripts/mvc/dataset/hda-base.js +++ b/static/scripts/mvc/dataset/hda-base.js @@ -78,16 +78,12 @@ itemWrapper.append( this._render_warnings() ); itemWrapper.append( this._render_titleBar() ); + //NOTE: only sets behaviors on title and warnings - body will set up it's own + this._setUpBehaviors( itemWrapper ); + this.body = $( this._render_body() ); itemWrapper.append( this.body ); - //TODO: move to own function: setUpBehaviours - // we can potentially skip this step and call popupmenu directly on the download button - make_popup_menus( itemWrapper ); - - // set up canned behavior on children (bootstrap, popupmenus, editable_text, etc.) - itemWrapper.find( '.tooltip' ).tooltip({ placement : 'bottom' }); - // transition... this.$el.fadeOut( 'fast', function(){ view.$el.children().remove(); @@ -155,6 +151,17 @@ }); }, + /** set up js behaviors, event handlers for elements within the given container + * @param {jQuery} $container jq object that contains the elements to process (defaults to this.$el) + */ + _setUpBehaviors : function( $container ){ + $container = $container || this.$el; + // set up canned behavior on children (bootstrap, popupmenus, editable_text, etc.) + //TODO: we can potentially skip this step and call popupmenu directly on the download button + make_popup_menus( $container ); + $container.find( '.tooltip' ).tooltip({ placement : 'bottom' }); + }, + // ................................................................................ RENDER titlebar /** Render any hda warnings including: is deleted, is purged, is hidden. * (including links to further actions (undelete, etc.)) @@ -389,6 +396,7 @@ body.append( $( '<div>Error: unknown dataset state "' + this.model.get( 'state' ) + '".</div>' ) ); } body.append( '<div style="clear: both"></div>' ); + this._setUpBehaviors( body ); }, /** Render inaccessible, not-owned by curr user. diff -r 715063d652abc9dc3197617012763284143e7ab2 -r eb39627264622db4805927d0d0f35972067a58b7 static/scripts/mvc/dataset/hda-model.js --- a/static/scripts/mvc/dataset/hda-model.js +++ b/static/scripts/mvc/dataset/hda-model.js @@ -220,7 +220,15 @@ * @returns array of encoded ids */ ids : function(){ - return this.map( function( item ){ return item.id; }); + return this.map( function( hda ){ return hda.id; }); + }, + + /** Get the hda with the given hid + * @param {Int} hid the hid to search for + * @returns {HistoryDatasetAssociation} the hda with the given hid or undefined if not found + */ + getByHid : function( hid ){ + return _.first( this.filter( function( hda ){ return hda.get( 'hid' ) === hid; }) ); }, /** If the given hid is in the collection, return it's index. If not, return the insertion point it would need. Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.