also make menu use percentages

somewhat responsive now
even it wont look good small
This commit is contained in:
Torsten Ruger 2018-04-18 17:54:58 +03:00
parent 6c597bea69
commit c379d0f09f
3 changed files with 26 additions and 33 deletions

View File

@ -1,44 +1,35 @@
body
font-family: arial, helvetica, serif
#nav, #nav ul /* all lists */
#nav , #nav ul
padding: 0
margin: 0
list-style: none
float: left
width: 190px
width: 100%
border-radius: 8px
background: black
border: 2px solid #C3D46A
#nav li /* all list items */
position: relative
float: left
line-height: 1.25em
width: 180px
#nav li ul /* second-level lists */
position: absolute
left: -999em
margin-left: 185px
margin-top: -2.7em
#nav li ul ul /* third-and-above-level lists */
left: -999em
#nav li a , li span
padding-left: 5px
width: 180px
display: block
text-decoration: none
background-color: black
border-radius: 7px
#nav
li
position: relative
float: left
line-height: 1.25em
width: 99%
a , span
width: 99%
display: block
text-decoration: none
background-color: black
border-radius: 7px
ul
position: absolute
left: -999em
margin-left: 99%
margin-top: -2.7em
ul
left: -999em
#nav li a:hover
color: white

View File

@ -28,13 +28,14 @@ end
class SelectView < ElementView
def initialize interpreter
def initialize( interpreter )
super
@interpreter = interpreter
@codes = nil
end
def draw
@element = div("h4", "Code") << (list = div("ul.nav!"))
@element = div("h4.select", "Code") << (list = div("ul.nav!"))
list << (div("li.code_list") << div("a.selected" , "none selected"))
selection_codes unless @codes
@element << div("br")
@ -47,6 +48,7 @@ class SelectView < ElementView
@codes << @codes.first if @codes.length == 1 #otherwise unselectable
@codes.each do |c|
code = div("li") << div("a" , c )
code.style["z-index"] = 10
code.on("click"){ select(c) }
list << code
end

View File

@ -45,7 +45,7 @@ class ObjectView < ListView
end
def content_elements
fields = [ConstantView.new("li" , "---------------------------------")]
fields = [ConstantView.new("li" , "------------------------------")]
object = @object
if object and ! object.is_a?(String)
object.get_instance_variables.each do |variable|