From: stefan Date: Mon, 16 Feb 2009 21:19:51 +0000 (+0000) Subject: Fix height calculation for Multilink.menu() X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0e52c41f35764f37f1e00d30203d3e6e6122a0da;p=roundup.git Fix height calculation for Multilink.menu() git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4134 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index 0cf33a9..73459f4 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -2083,7 +2083,18 @@ class MultilinkHTMLProperty(HTMLProperty): for opt in linkcl.filter(None, conditions, sort_on) if self._db.security.hasPermission("View", self._client.userid, linkcl.classname, itemid=opt)] - height = height or min(len(options), 7) + + # make sure we list the current values if they're retired + for val in value: + if val not in options: + options.insert(0, val) + + if not height: + height = len(options) + if value: + # The "no selection" option. + height += 1 + height = min(height, 7) l = ['