commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/9d479bd48524/ changeset: 9d479bd48524 user: jgoecks date: 2012-04-08 17:44:21 summary: Do not use individual views for buttons in icon button menus. affected #: 1 file diff -r 8f9ac3a5dc612e56a5fca04230331d8308a882b8 -r 9d479bd4852431d71adb3dcd339744e510ea6433 static/scripts/backbone/ui.js --- a/static/scripts/backbone/ui.js +++ b/static/scripts/backbone/ui.js @@ -18,40 +18,21 @@ }); /** - * A single icon button. - */ -var IconButtonView = Backbone.View.extend({ - tagName: 'a', - className: 'icon-button menu-button', - - events: { - 'click': 'on_click' - }, - - render: function() { - this.$el.attr('href', 'javascript:void(0)') - .attr('title', this.model.attributes.title) - .addClass(this.model.attributes.icon_class); - return this; - }, - - on_click: function() { - this.model.attributes.on_click(); - } -}); - -/** - * Menu with multiple icon buttons. + * Menu with multiple icon buttons. Views are not needed nor used for individual buttons. */ var IconButtonMenuView = Backbone.View.extend({ tagName: 'div', render: function() { var self = this; - this.collection.each(function(icon_button) { - var view = new IconButtonView({model: icon_button}); - view.render(); - self.$el.append(view.$el); + this.collection.each(function(button) { + // Create and add icon button to menu. + $("<a/>").attr('href', 'javascript:void(0)') + .attr('title', button.attributes.title) + .addClass('icon-button menu-button') + .addClass(button.attributes.icon_class) + .appendTo(self.$el) + .click(button.attributes.on_click); }); return this; } https://bitbucket.org/galaxy/galaxy-central/changeset/90ace706e150/ changeset: 90ace706e150 user: jgoecks date: 2012-04-08 18:15:54 summary: Use postdraw_actions rather than predraw_init to reset track parameters after executing tool and fetching data. affected #: 1 file diff -r 9d479bd4852431d71adb3dcd339744e510ea6433 -r 90ace706e150f651a540bfcd9fc369fd857115b9 static/scripts/trackster.js --- a/static/scripts/trackster.js +++ b/static/scripts/trackster.js @@ -3894,28 +3894,28 @@ this.data_query_wait = 1000; this.dataset_check_url = dataset_state_url; - /** - * Predraw init sets up postdraw init. - */ - this.predraw_init = function() { - // Postdraw init: once data has been fetched, reset data url, wait time and start indexing. - var track = this; - var post_init = function() { - if (track.data_manager.size() === 0) { - // Track still drawing initial data, so do nothing. - setTimeout(post_init, 300); - } - else { - // Track drawing done: reset dataset check, data URL, wait time and get dataset state to start - // indexing. - track.data_url = default_data_url; - track.data_query_wait = DEFAULT_DATA_QUERY_WAIT; - track.dataset_state_url = converted_datasets_state_url; - $.getJSON(track.dataset_state_url, {dataset_id : track.dataset_id, hda_ldda: track.hda_ldda}, function(track_data) {}); - } - }; - post_init(); - } + // + // Set up one-time, post-draw to clear tool execution settings. + // + this.normal_postdraw_actions = this.postdraw_actions; + this.postdraw_actions = function(tiles, width, w_scale, clear_after) { + var self = this; + + // Do normal postdraw init. + self.normal_postdraw_actions(tiles, width, w_scale, clear_after); + + // Tool-execution specific post-draw init: + + // Reset dataset check, data URL, wait time. + self.data_url = default_data_url; + self.data_query_wait = DEFAULT_DATA_QUERY_WAIT; + self.dataset_state_url = converted_datasets_state_url; + // Get dataset state to indexing. + $.getJSON(self.dataset_state_url, {dataset_id : self.dataset_id, hda_ldda: self.hda_ldda}, function(track_data) {}); + + // Reset post-draw actions function. + self.postdraw_actions = self.normal_postdraw_actions; + }; } }); 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.
participants (1)
-
Bitbucket