From 83e20a2824f1b0535e2beb7a811aa3d6d77a0e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Betn=C3=A9r?= Date: Sat, 22 Apr 2006 21:06:34 +0000 Subject: [PATCH] Use css overflow on genres/artists/album select boxes instead of truncating the text --- admin-root/playlist.html | 1 + admin-root/playlist.js | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/admin-root/playlist.html b/admin-root/playlist.html index bcd9db3c..42f5e9ec 100644 --- a/admin-root/playlist.html +++ b/admin-root/playlist.html @@ -3,6 +3,7 @@ #genre_div select, #artist_div select, #album_div select { font: icon; width: 30ex; + overflow: hidden; } #source_div select { font: icon; diff --git a/admin-root/playlist.js b/admin-root/playlist.js index 0102104f..0ad305c1 100644 --- a/admin-root/playlist.js +++ b/admin-root/playlist.js @@ -5,7 +5,8 @@ Event.observe(window,'load',initPlaylist); var SEARCH_DELAY = 500; // # ms without typing before the search box searches -var BROWSE_TEXT_LEN = 30; // Length to truncate genre/artist/album select boxes +var BROWSE_TEXT_LEN = 30; // genres/artists/albums select options longer than this will have + // a title attribute (to show a tool tip for items that doesn't fit the box var g_myLiveGrid; // the live grid; function initPlaylist() { Ajax.Responders.register({ onCreate: Spinner.incRequestCount, @@ -423,13 +424,10 @@ var ResponseHandler = { // with the selected state I want. var o = document.createElement('option'); o.value = option; - var text = option.truncate(BROWSE_TEXT_LEN); - if (option.length != text.length) { + if (option.length >= BROWSE_TEXT_LEN) { o.title = option; - o.appendChild(document.createTextNode(text)); - } else { - o.appendChild(document.createTextNode(option)); } + o.appendChild(document.createTextNode(option)); if (selected[option]) { o.selected = true; nothingSelected = false;