Handbook
Glossary
update-selectedcontent ( select -- )
Vocabulary
html5
Inputs
select
an
object
Outputs
None
Definition
USING:
accessors
assocs
combinators.short-circuit
kernel
sequences
;
IN:
html5
::
update-selectedcontent
( select -- )
select
attributes>>
"multiple"
swap
key?
[
select
children>>
tree-elements
:>
elements elements
[
{
[
"selectedcontent"
html-element-named?
]
[
select
selectedcontent-enabled?
]
}
1&&
]
filter
:>
contents contents
empty?
[
select elements
selected-option
:>
option contents
[
:>
content content
children>>
clone
[
dup
tag?
[
detach-node
]
[
drop
]
if
]
each
content
children>>
delete-all
option
[
option
children>>
[
clone-tree-node
content
attach-node
]
each
]
when
]
each
]
unless
]
unless
;