Moved set_attributes from BASIC_CONTROL to STATELESS_CONTROL

This commit is contained in:
severin
2014-01-04 10:30:34 +01:00
parent 9c9a132329
commit 37aac7053a
5 changed files with 15 additions and 15 deletions

View File

@@ -20,19 +20,19 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make ( title: STRING) make (title: STRING)
-- Make a dropdown control with div tag name and specified menu title -- Make a dropdown control with div tag name and specified menu title
do do
make_with_tag_name ( title, "div") make_with_tag_name (title, "div")
end end
make_with_tag_name ( title, t: STRING) make_with_tag_name (title, t: STRING)
-- Make a dropdown control with specified tag name and menu title (such as li) -- Make a dropdown control with specified tag name (such as li) and menu title
do do
make_multi_control_with_tag_name ( t) make_multi_control_with_tag_name (t)
add_class ("dropdown") add_class ("dropdown")
create {WSF_BASIC_CONTROL} dropdown_toggle.make_with_body_class ("a", "data-toggle=%"dropdown%" href=%"#%"", "dropdown-toggle", title + " <strong class=%"caret%"></strong>") create {WSF_BASIC_CONTROL} dropdown_toggle.make_with_body_class ("a", "data-toggle=%"dropdown%" href=%"#%"", "dropdown-toggle", title + " <strong class=%"caret%"></strong>")
create dropdown_menu.make_with_tag_name ( "ul") create dropdown_menu.make_with_tag_name ("ul")
dropdown_menu.add_class ("dropdown-menu") dropdown_menu.add_class ("dropdown-menu")
add_control (dropdown_toggle) add_control (dropdown_toggle)
add_control (dropdown_menu) add_control (dropdown_menu)

View File

@@ -20,7 +20,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (v: STRING) make (v: STRING)
-- Initialize with specified name and value -- Initialize with specified value
do do
make_value_control ("input") make_value_control ("input")
type := "text" type := "text"

View File

@@ -36,7 +36,7 @@ feature {NONE} -- Initialization
end end
make_with_body_class (t, attr, c, b: STRING) make_with_body_class (t, attr, c, b: STRING)
-- Initialize with specific attributes and body -- Initialize with specific class, attributes and body
do do
make_with_body (t, attr, b) make_with_body (t, attr, b)
if not c.is_empty then if not c.is_empty then
@@ -54,12 +54,6 @@ feature -- Rendering
feature -- Change feature -- Change
set_attributes (a: STRING)
-- Set the attributes string of this control
do
attributes := a
end
set_body (b: STRING) set_body (b: STRING)
-- Set the body of this control -- Set the body of this control
do do

View File

@@ -19,7 +19,7 @@ inherit
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (a_tag_name: STRING) make (a_tag_name: STRING)
-- Initialize with specified control name and tag -- Initialize with specified and tag
require require
not a_tag_name.is_empty not a_tag_name.is_empty
do do

View File

@@ -43,6 +43,12 @@ feature -- Change
css_classes.prune (cla) css_classes.prune (cla)
end end
set_attributes (a: STRING)
-- Set the attributes of this control
do
attributes := a
end
feature -- Rendering feature -- Rendering
render_tag (body: STRING; attrs: detachable STRING): STRING render_tag (body: STRING; attrs: detachable STRING): STRING