commit/galaxy-central: jgoecks: Trackster: inline editing of LineTrack min and max values.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/55a4070a62e7/ changeset: 55a4070a62e7 user: jgoecks date: 2012-01-31 21:55:21 summary: Trackster: inline editing of LineTrack min and max values. affected #: 3 files diff -r 115068e367b39bf55a04d9254293d698023f2ab9 -r 55a4070a62e73ddd3ff387cb46a27410a2847110 static/june_2007_style/blue/trackster.css --- a/static/june_2007_style/blue/trackster.css +++ b/static/june_2007_style/blue/trackster.css @@ -18,8 +18,9 @@ .overview-boxback{width:100%;bottom:0px;z-index:50;position:absolute;height:14px;background:#eee;border:solid #999 1px;} .overview-box{cursor:pointer;bottom:0px;z-index:100;position:absolute;margin-top:0px;height:14px;background:#C1C9E5 url(../images/visualization/draggable_horizontal.png) center center no-repeat;border:solid #666 1px;} .viewport-canvas{width:100%;height:100px;} -.yaxislabel{z-index:101;} -.yaxislabel.histogram-max{position:absolute;top:24px;left:10px;} +.yaxislabel{z-index:101;position:absolute;} +.yaxislabel.top{top:24px;left:10px;} +.yaxislabel.bottom{bottom:2px;left:10px;} .line-track .track-content{border-top:1px solid #eee;border-bottom:1px solid #eee;} .group-handle{cursor:move;float:left;background:#eee url('../images/tracks/block.png');width:12px;height:12px;} .group{min-height:20px;border-top:2px solid #888;border-bottom:2px solid #888;} diff -r 115068e367b39bf55a04d9254293d698023f2ab9 -r 55a4070a62e73ddd3ff387cb46a27410a2847110 static/june_2007_style/trackster.css.tmpl --- a/static/june_2007_style/trackster.css.tmpl +++ b/static/june_2007_style/trackster.css.tmpl @@ -123,13 +123,19 @@ .yaxislabel { /* Needs to be > canvas z-index. */ z-index: 101; + position: absolute; } -.yaxislabel.histogram-max { - position: absolute; + +.yaxislabel.top { top: 24px; left: 10px; } +.yaxislabel.bottom { + bottom: 2px; + left: 10px; +} + /* Line track needs borders to show range */ .line-track .track-content { border-top: 1px solid #eee; diff -r 115068e367b39bf55a04d9254293d698023f2ab9 -r 55a4070a62e73ddd3ff387cb46a27410a2847110 static/scripts/trackster.js --- a/static/scripts/trackster.js +++ b/static/scripts/trackster.js @@ -4032,11 +4032,8 @@ onchange: function() { track.set_name(track.prefs.name); track.vertical_range = track.prefs.max_value - track.prefs.min_value; - // Update the y-axis - $('#linetrack_' + track.dataset_id + '_minval').text(track.prefs.min_value); - $('#linetrack_' + track.dataset_id + '_maxval').text(track.prefs.max_value); - track.tile_cache.clear(); - track.request_draw(); + track.set_min_value(track.prefs.min_value); + track.set_max_value(track.prefs.max_value); } }); @@ -4047,6 +4044,24 @@ this.add_resize_handle(); }; extend(LineTrack.prototype, Drawable.prototype, TiledTrack.prototype, { + /** + * Set track minimum value. + */ + set_min_value: function(new_val) { + this.prefs.min_value = new_val; + $('#linetrack_' + this.dataset_id + '_minval').text(this.prefs.min_value); + this.tile_cache.clear(); + this.request_draw(); + }, + /** + * Set track maximum value. + */ + set_max_value: function(new_val) { + this.prefs.max_value = new_val; + $('#linetrack_' + this.dataset_id + '_maxval').text(this.prefs.max_value); + this.tile_cache.clear(); + this.request_draw(); + }, add_resize_handle: function () { // Add control for resizing // Trickery here to deal with the hovering drag handle, can probably be @@ -4114,14 +4129,21 @@ // Draw y-axis labels if necessary track.container_div.find(".yaxislabel").remove(); - var min_label = $("<div />").addClass('yaxislabel').attr("id", 'linetrack_' + track.dataset_id + '_minval').text(round(track.prefs.min_value, 3)); - var max_label = $("<div />").addClass('yaxislabel').attr("id", 'linetrack_' + track.dataset_id + '_maxval').text(round(track.prefs.max_value, 3)); - - max_label.css({ position: "absolute", top: "24px", left: "10px" }); - max_label.prependTo(track.container_div); - - min_label.css({ position: "absolute", bottom: "2px", left: "10px" }); - min_label.prependTo(track.container_div); + // Add min, max labels. + var min_label = get_editable_text_elt(round(track.prefs.min_value, 3), false, 6, null, function(new_val) { + var new_val = parseFloat(new_val); + if (!isNaN(new_val)) { + track.set_min_value(new_val); + } + } ).addClass('yaxislabel bottom').attr("id", 'linetrack_' + track.dataset_id + '_minval') + .prependTo(track.container_div), + max_label = get_editable_text_elt(round(track.prefs.max_value, 3), false, 6, null, function(new_val) { + var new_val = parseFloat(new_val); + if (!isNaN(new_val)) { + track.set_max_value(new_val); + } + } ).addClass('yaxislabel top').attr("id", 'linetrack_' + track.dataset_id + '_maxval') + .prependTo(track.container_div); }); }, /** @@ -4285,7 +4307,7 @@ track.tile_cache.clear(); track.request_draw(); }) - .addClass('yaxislabel histogram-max') + .addClass('yaxislabel top') .css("color", this.prefs.label_color); this.container_div.prepend(max_label); } 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