Commit f516669e authored by Nicolas's avatar Nicolas

l'axe déplacé prend la condition qui vient de son nouveaui parent

parent 82ce55d3
......@@ -74,10 +74,9 @@ window.W = window.W || {};
'relocateChild': 'relocateChild'
},
// Triggered by jquery nested sortable when the item is
// Triggered by jquery nested sortable when the item is
relocate: function(event, index) {
var parentItem = this.$el.parent().closest("li");
parentItem.trigger('relocateChild', [this.model, index]);
return false;
......@@ -85,9 +84,18 @@ window.W = window.W || {};
// Triggered by a subline view beeing relocated
relocateChild: function(event, model, index) {
model.get("parent").get("sublines").remove(model);
this.model.get("sublines").add(model, {at: index});
console.log("relocate", model.get("parent").get("alternative_mode"));
var alts;
if(model.get("parent").get("alternative_mode")){
alts = "V" + model.get("parent").get('alternative_n') + "-" + model.get("parent").get('alternative_p');
if(model.get("parent").get("alternative_mode") == "exclusive"){
alts = "V"+model.get("parent").get('alternative_p');
}
model.set('alternative_symbole',alts);
}
return false;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment