commit/galaxy-central: jgoecks: Visualization framework: code cleanup.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/929576b077c9/ Changeset: 929576b077c9 User: jgoecks Date: 2013-10-11 18:03:55 Summary: Visualization framework: code cleanup. Affected #: 2 files diff -r 6634ab26b76f8da657157e8373dc5424d0b89435 -r 929576b077c9e92ebfe26ae8730de791a7d4a759 static/scripts/viz/trackster/tracks.js --- a/static/scripts/viz/trackster/tracks.js +++ b/static/scripts/viz/trackster/tracks.js @@ -1614,7 +1614,7 @@ initialize: function(options) { // Restore tool visibility from state. if (options.tool_state !== undefined) { - this.set('hidden', options.tool_state.hidden) + this.set('hidden', options.tool_state.hidden); } // FIXME: need to restore tool values from options.tool_state @@ -2291,8 +2291,8 @@ // parseInt strips "px" from left, top measurements. +7 so that mouse pointer does not // overlap popup. var - popupX = offsetX + parseInt( tile.html_elt.css("left") ) - popup.width() / 2, - popupY = offsetY + parseInt( tile.html_elt.css("top") ) + 7; + popupX = offsetX + parseInt( tile.html_elt.css("left"), 10 ) - popup.width() / 2, + popupY = offsetY + parseInt( tile.html_elt.css("top"), 10 ) + 7; popup.css("left", popupX + "px").css("top", popupY + "px"); } else if (!e.isPropagationStopped()) { @@ -2715,20 +2715,24 @@ }) ); } - } else if (result === "no converter") { + } + else if (result === "no converter") { track.container_div.addClass("error"); track.tiles_div.text(DATA_NOCONVERTER); - } else if (result === "no data" || (result.data !== undefined && (result.data === null || result.data.length === 0))) { + } + else if (result === "no data" || (result.data !== undefined && (result.data === null || result.data.length === 0))) { track.container_div.addClass("nodata"); track.tiles_div.text(DATA_NONE); - } else if (result === "pending") { + } + else if (result === "pending") { track.container_div.addClass("pending"); track.tiles_div.html(DATA_PENDING); //$("<img/>").attr("src", image_path + "/yui/rel_interstitial_loading.gif").appendTo(track.tiles_div); setTimeout(function() { track.init(); }, track.data_query_wait); - } else if (result === "data" || result['status'] === "data") { - if (result['valid_chroms']) { - track.valid_chroms = result['valid_chroms']; + } + else if (result === "data" || result.status === "data") { + if (result.valid_chroms) { + track.valid_chroms = result.valid_chroms; track.update_icons(); } track.tiles_div.text(DATA_OK); @@ -3276,7 +3280,7 @@ } drawing_modes.push(mode); drawing_heights.push(d.get_canvas_height(data, mode, w_scale, width)); - }) + }); var canvas = track.view.canvas_manager.new_canvas(), tile_low = region.get('start'), @@ -4062,10 +4066,9 @@ /** * Update track interface to show display mode being used. */ - update_auto_mode: function( mode ) { - var mode; - if ( this.mode === "Auto" ) { - if ( mode === "no_detail" ) { + update_auto_mode: function(mode) { + if (this.mode === "Auto") { + if (mode === "no_detail") { mode = "feature spans"; } this.action_icons.mode_icon.attr("title", "Set display mode (now: Auto/" + mode + ")"); @@ -4436,10 +4439,10 @@ else { // Template is a dictionary. var - drawable_type = template['obj_type']; + drawable_type = template.obj_type; // For backward compatibility: if (!drawable_type) { - drawable_type = template['track_type']; + drawable_type = template.track_type; } return new addable_objects[ drawable_type ](view, container, template); } diff -r 6634ab26b76f8da657157e8373dc5424d0b89435 -r 929576b077c9e92ebfe26ae8730de791a7d4a759 static/scripts/viz/visualization.js --- a/static/scripts/viz/visualization.js +++ b/static/scripts/viz/visualization.js @@ -1,5 +1,4 @@ -define( ["libs/underscore", "mvc/data", "viz/trackster/util", "utils/config"], - function(_, data_mod, util_mod, config_mod) { +define( ["libs/underscore", "mvc/data", "viz/trackster/util", "utils/config"], function(_, data_mod, util_mod, config_mod) { /** * Model, view, and controller objects for Galaxy visualization framework. @@ -409,10 +408,11 @@ // This would prevent bad extensions when zooming in/out while still preserving the behavior // below. + // Use copy of region to avoid changing actual region. + region = region.copy(); + // Use heuristic to extend region: extend relative to last data request. - var last_request = this.most_recently_added(), - // Use copy of region to avoid changing actual region. - region = region.copy(); + var last_request = this.most_recently_added(); if (!last_request || (region.get('start') > last_request.get('start'))) { // This request is after the last request, so extend right. region.set('end', region.get('start') + this.attributes.min_region_size); 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)
-
commits-noreply@bitbucket.org