Fix field edition for vocabulary

This commit is contained in:
Nicolas Le Goff
2013-10-31 14:38:35 +01:00
parent 36f7b24f26
commit 409a43db0c
3 changed files with 22 additions and 0 deletions

View File

@@ -89,11 +89,22 @@ define([
"blur input#tbranch": "fieldChangedAction",
"blur input#separator": "fieldChangedAction",
"blur input#tag": "tagFieldChangedAction",
"change select#vocabulary-type": "triggerControlledVocabulary",
"keyup input.input-label": "labelChangedAction",
"change input[type=checkbox]": "fieldChangedAction",
"change select": "selectionChangedAction",
"click .lng-label a": "_toggleLabels"
},
triggerControlledVocabulary: function(e) {
if ($(e.target, this.$el).find("option:selected").val() === "") {
this.model.set("vocabulary-type", false);
this.render();
} else if ($("input#vocabulary-restricted", this.$el).length === 0) {
this.model.set("vocabulary-restricted", false);
this.model.set("vocabulary-type", $(e.target, this.$el).find("option:selected").val());
this.render();
}
},
selectionChangedAction: function(e) {
var field = $(e.target);
var data = {};