Bugfix in room configuration code.

This commit is contained in:
JC Brand 2013-05-20 22:16:35 +02:00
parent 316d3f3396
commit feac7363ae
2 changed files with 6 additions and 4 deletions

View File

@ -536,6 +536,7 @@ p.room-info {
a.room-info { a.room-info {
background: url('images/information.png') no-repeat right top; background: url('images/information.png') no-repeat right top;
width: 22px; width: 22px;
height: 22px;
float: right; float: right;
display: none; display: none;
} }

View File

@ -1138,6 +1138,7 @@
for (i=0; i<$fields.length; i++) { for (i=0; i<$fields.length; i++) {
$field = $($fields[i]); $field = $($fields[i]);
if ($field.attr('type') == 'list-single') { if ($field.attr('type') == 'list-single') {
options = [];
$options = $field.find('option'); $options = $field.find('option');
for (j=0; j<$options.length; j++) { for (j=0; j<$options.length; j++) {
options.push(this.select_option_template({ options.push(this.select_option_template({
@ -1155,7 +1156,7 @@
name: $field.attr('var'), name: $field.attr('var'),
type: input_types[$field.attr('type')], type: input_types[$field.attr('type')],
label: $field.attr('label') || '', label: $field.attr('label') || '',
checked: $field.find('value').text() && 'checked="1"' || '' checked: $field.find('value').text() === "1" && 'checked="1"' || ''
})); }));
} else { } else {
$form.append(this.form_input_template({ $form.append(this.form_input_template({
@ -1196,8 +1197,8 @@
converse.connection.muc.saveConfiguration( converse.connection.muc.saveConfiguration(
that.model.get('jid'), that.model.get('jid'),
configArray, configArray,
that.onConfigSaved, $.proxy(that.onConfigSaved, that),
that.onErrorConfigSaved $.proxy(that.onErrorConfigSaved, that)
); );
} }
}); });
@ -1214,7 +1215,7 @@
}, },
onErrorConfigSaved: function (stanza) { onErrorConfigSaved: function (stanza) {
// XXX this.insertStatusNotification("An error occurred while trying to save the form.");
}, },
cancelConfiguration: function (ev) { cancelConfiguration: function (ev) {