Fix #1453 Edition field on firefox

This commit is contained in:
Nicolas Le Goff
2013-09-27 18:35:10 +02:00
parent af6dc0f565
commit d4045f968c
2 changed files with 8 additions and 3 deletions

View File

@@ -89,7 +89,7 @@ define([
"blur input#tbranch": "fieldChangedAction", "blur input#tbranch": "fieldChangedAction",
"blur input#separator": "fieldChangedAction", "blur input#separator": "fieldChangedAction",
"blur input#tag": "tagFieldChangedAction", "blur input#tag": "tagFieldChangedAction",
"blur input.input-label": "labelChangedAction", "keyup input.input-label": "labelChangedAction",
"change input[type=checkbox]": "fieldChangedAction", "change input[type=checkbox]": "fieldChangedAction",
"change select": "selectionChangedAction", "change select": "selectionChangedAction",
"click .lng-label a": "_toggleLabels" "click .lng-label a": "_toggleLabels"
@@ -194,8 +194,7 @@ define([
}, },
_onModelChange: function() { _onModelChange: function() {
AdminFieldApp.fieldListView.collection.remove(this.model, {silent: true}); AdminFieldApp.fieldListView.collection.remove(this.model, {silent: true});
AdminFieldApp.fieldListView.collection.add(this.model); AdminFieldApp.fieldListView.collection.add(this.model, {silent: true});
AdminFieldApp.saveView.updateStateButton(); AdminFieldApp.saveView.updateStateButton();
}, },
// select temView by index in itemList // select temView by index in itemList

View File

@@ -18,6 +18,7 @@ define([
className: "field-row", className: "field-row",
initialize: function() { initialize: function() {
// destroy view is model is deleted // destroy view is model is deleted
this.model.on("change", this.onChange, this);
this.model.on("destroy", this.remove, this); this.model.on("destroy", this.remove, this);
}, },
events : { events : {
@@ -45,6 +46,11 @@ define([
return this; return this;
}, },
onChange: function() {
if (this.model.hasChanged("tag")) {
this.render();
}
},
render: function() { render: function() {
var template = _.template($("#list_row_template").html(), { var template = _.template($("#list_row_template").html(), {
id: this.model.get("id"), id: this.model.get("id"),