commit/galaxy-central: james_taylor: trackster: color picker shows on click, not hover, and below the input element
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/48d1f796acd4/ changeset: r5009:48d1f796acd4 user: james_taylor date: 2011-02-06 16:27:53 summary: trackster: color picker shows on click, not hover, and below the input element affected #: 1 file (215 bytes) --- a/static/scripts/trackster.js Sun Feb 06 02:21:10 2011 -0500 +++ b/static/scripts/trackster.js Sun Feb 06 10:27:53 2011 -0500 @@ -863,18 +863,21 @@ var value = track_config.values[ param.key ]; var input = $('<input />').attr("id", id ).attr("name", id ).val( value ); // Color picker in tool tip style float - var tip = $( "<div class='tipsy tipsy-west' style='position: absolute;' />" ) + var tip = $( "<div class='tipsy tipsy-north' style='position: absolute;' />" ) .append( $("<div class='tipsy-inner' />") .farbtastic( { width: 100, height: 100, callback: input, color: value } ) ) .hide(); // Outer div container input and tip for hover to work - $("<div />").append( input ).append( tip ).appendTo( row ).hover( function () { + $("<div />").append( input ).append( tip ).appendTo( row ).bind( "click", function ( e ) { tip.css( { - left: $(this).position().left + $(input).width() - 20, - top: $(this).position().top - 50 - } ).show(); - }, function () { - tip.hide(); + left: $(this).position().left + ( $(input).width() / 2 ) - 60, + top: $(this).position().top + $(this.height) + } ).show(); + $(document).bind( "click.color-picker", function() { + tip.hide(); + $(document).unbind( "click.color-picker" ); + }); + e.stopPropagation(); } ); } else { row.append( $('<input />').attr("id", id ).attr("name", id ).val( track_config.values[ param.key ] ) ); 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