Handle option.disabled

This commit is contained in:
Zixaphir 2014-03-06 20:43:33 -07:00
parent c440c236ad
commit ac20dcf81f
4 changed files with 22 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -84,6 +84,10 @@ body > hr {
.index #returnlink { .index #returnlink {
display: none; display: none;
} }
#index-menu .selectrice {
width: 110px;
display: inline-block;
}
#index-search { #index-search {
padding-right: 1.5em; padding-right: 1.5em;
width: 100px; width: 100px;
@ -120,7 +124,6 @@ body > hr {
#index-last-refresh::after { #index-last-refresh::after {
content: ']'; content: ']';
} }
.catalog-mode .board { .catalog-mode .board {
text-align: center; text-align: center;
} }

View File

@ -57,6 +57,8 @@ Rice =
option: (e) -> option: (e) ->
e.stopPropagation() e.stopPropagation()
e.preventDefault() e.preventDefault()
return if @dataset.disabled
select = Rice.input select = Rice.input
container = select.nextElementSibling container = select.nextElementSibling
@ -87,6 +89,8 @@ Rice =
for option in select.options for option in select.options
li = $.el 'li', textContent: option.textContent li = $.el 'li', textContent: option.textContent
li.dataset.value = option.value li.dataset.value = option.value
if option.disabled
li.dataset.disabled = true
$.on li, 'click', Rice.cb.option $.on li, 'click', Rice.cb.option
nodes.push li nodes.push li