Added more comments and assertions to all classes; clean up

This commit is contained in:
severin
2014-03-19 16:49:24 +01:00
parent c5363c948c
commit 4e7e1e9c45
25 changed files with 223 additions and 83 deletions

View File

@@ -29,10 +29,12 @@ feature {NONE} -- Initialization
make_with_tag_name (title, "div")
end
make_with_tag_name (title, t: STRING_32)
make_with_tag_name (title, tag: STRING_32)
-- Make a dropdown control with specified tag name (such as li) and menu title
require
tag_not_empty: not tag.is_empty
do
make_multi_control_with_tag_name (t)
make_multi_control_with_tag_name (tag)
add_class ("dropdown")
create {WSF_BASIC_CONTROL} dropdown_toggle.make_with_body_class ("a", "data-toggle=%"dropdown%" href=%"#%" type=%"button%" id=%"" + control_name + "_toggle%"", "dropdown-toggle", title + " <strong class=%"caret%"></strong>")
create dropdown_menu.make_with_tag_name ("ul")
@@ -45,6 +47,7 @@ feature {NONE} -- Initialization
feature -- Change
add_item (c: WSF_STATELESS_CONTROL)
-- Wrap the specified control into a <li> tag and add it to the menu
local
li: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
do
@@ -56,6 +59,7 @@ feature -- Change
end
add_link_item (label, link: STRING_32)
-- Add an item to the menu which redirects to the specified link
local
c: WSF_BASIC_CONTROL
do
@@ -64,6 +68,7 @@ feature -- Change
end
add_divider
-- Append a horizontal divider to the menu
do
dropdown_menu.add_control (create {WSF_BASIC_CONTROL}.make_with_body_class ("li", "role=%"menuitem%"", "divider", ""))
end
@@ -71,7 +76,9 @@ feature -- Change
feature -- Properties
dropdown_toggle: WSF_STATELESS_CONTROL
-- The dropdown toggle which causes the menu to pop up or dispose
dropdown_menu: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL]
-- The dropdown menu which holds the single entries (controls and dividers)
end