Make divider not selectable

Very hacky
This commit is contained in:
kondou 2013-04-19 00:39:42 +02:00
parent 79218be1d2
commit 7a2be0c5dc
2 changed files with 4 additions and 5 deletions

View file

@ -86,12 +86,11 @@ $(document).ready(function(){
});
$("#languageinput").chosen();
// Show only the not selectable optgroup
// Choosen only shows optgroup-labels if there are options in the optgroup
$(".languagedivider").remove();
$("#languageinput").change( function(){
// the divider is no language
if ($("#languageinput option").hasClass('divider')) {
return false;
}
// Serialize the data
var post = $( "#languageinput" ).serialize();
// Ajax foo

View file

@ -82,7 +82,7 @@ if($_['displayNameChangeSupported']) {
<?php foreach($_['commonlanguages'] as $language):?>
<option value="<?php p($language['code']);?>"><?php p($language['name']);?></option>
<?php endforeach;?>
<option class="divider"></option>
<optgroup label=""><option class="languagedivider">-</option></optgroup>
<?php foreach($_['languages'] as $language):?>
<option value="<?php p($language['code']);?>"><?php p($language['name']);?></option>
<?php endforeach;?>