From 5f47ae318779c9f20655b1dd3d3c826ffaa0532e Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Mon, 18 May 2009 14:48:24 -0700 Subject: [PATCH] Fixed hiding of table border in color pulldown in IE. Tweak light/dark threshold. Added :hover border on color boxes. --- static/css/style.css | 8 ++++++-- static/js/Wiki.js | 18 +++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/static/css/style.css b/static/css/style.css index 1f94d5e..75f0112 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -857,13 +857,13 @@ h1 { } #color_table { + border: none; border-collapse: collapse; - border: 1px solid #000000; margin-top: 1em; } #color_table td { - border: 1px solid #000000; + border: 1px solid transparent; width: 1.5em; height: 1.5em; text-align: center; @@ -884,6 +884,10 @@ h1 { margin: 0; } +#color_table .color_box:hover { + border: 2px solid #eeeeee; +} + .color_box_dark_selected { color: #ffffff; } diff --git a/static/js/Wiki.js b/static/js/Wiki.js index 41ff0d3..a3e1117 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -3306,10 +3306,18 @@ Pulldown.prototype.update_position = function ( always_left_align ) { new Move( this.div, { "x": position.x, "y": viewport_bottom - div_height, "mode": "absolute", "duration": 0.25 } ); } +Pulldown.prototype.show = function () { + // implemented in derived object +} + +Pulldown.prototype.hide = function () { + // implemented in derived object +} + Pulldown.prototype.shutdown = function () { // if this pulldown is to be cached, then simply hide it rather than shutting it down completely if ( this.cache ) { - addElementClass( this.div, "invisible" ); + this.hide(); return false; } @@ -4725,12 +4733,12 @@ Color_pulldown.prototype.color_mouse_pressed = function ( event ) { } Color_pulldown.prototype.color_mouse_released = function ( event ) { + event.stop(); + var self = this; setTimeout( function () { self.shutdown(); }, 100 ); - - event.stop(); } Color_pulldown.prototype.select_color = function ( color_code, skip_set ) { @@ -4750,9 +4758,9 @@ Color_pulldown.prototype.select_color_box = function ( color_box, color_code, sk if ( color_code == undefined || color_code == null ) color_code = getStyle( color_box, "background-color" ); - var LIGHT_DARK_THRESHOLD = 0.5; + var LIGHT_DARK_THRESHOLD = 0.45; - if ( Color.fromString( color_code ).asHSL().l > LIGHT_DARK_THRESHOLD ) + if ( Color.fromString( color_code ).asHSL().l >= LIGHT_DARK_THRESHOLD ) addElementClass( color_box, "color_box_light_selected" ); else addElementClass( color_box, "color_box_dark_selected" );