Commit 7cbd4552 authored by Tristan Cavelier's avatar Tristan Cavelier

Fix bug: remove several files function was not updated

parent 807973ae
......@@ -407,7 +407,6 @@
priv.data_object.currentSolver = realapp;
break;
default:
priv.data_object.currentEditor = null;
break;
}
priv.data_object.currentApp = realapp;
......@@ -531,7 +530,6 @@
priv.data_object.documentList = result;
priv.showDocumentListInsideLeftNavBar();
priv.loading_object.end_getlist();
// TODO : announce conflicts
if (typeof callback === 'function') {
callback();
}
......@@ -585,7 +583,6 @@
that.getList();
if (error.conflict_object) {
priv.onConflict (error.conflict_object);
// TODO : same for remove method
}
}
});
......@@ -629,8 +626,10 @@
* Removes a document.
* @method remove
* @param {string} name The document name.
* @param {string} revision The document name.
*/
that.remove = function (name,revision) {
console.log (arguments);
if (!priv.isJioSet()) {
console.error ('No Jio set yet.');
return;
......@@ -638,7 +637,7 @@
priv.loading_object.remove();
priv.jio.removeDocument(
name,{
revision: revision,
revision: revision || 'last',
success: function (result) {
priv.loading_object.end_remove();
that.getList();
......@@ -651,7 +650,6 @@
that.getList();
if (error.conflict_object) {
priv.onConflict (error.conflict_object);
// TODO : same for remove method
}
}
});
......@@ -668,11 +666,7 @@
console.error ('No Jio set yet.');
return;
}
for (i = 0, l = documentarray.length; i < l; i+= 1) {
priv.loading_object.remove();
priv.jio.removeDocument(
documentarray[i],
{onResponse:function (result) {
var onResponse = function (result) {
cpt += 1;
if (cpt === l) {
if (typeof current_editor.update !== 'undefined') {
......@@ -686,7 +680,15 @@
}
}
priv.loading_object.end_remove();
}});
};
for (i = 0, l = documentarray.length; i < l; i+= 1) {
priv.loading_object.remove();
priv.jio.removeDocument(
documentarray[i],{
revision: 'last',
success: onResponse,
error: onResponse
});
}
};
......@@ -709,9 +711,15 @@
// }
};
/**
* Solve the conflict
* @method solveConflict
* @param {object} conflict_data The conflict object
* @param {string} data The new content of the new revision
*/
that.solveConflict = function (conflict_object, data) {
that.closeGadgetId (priv.data_object.currentSolver.gadget_id);
priv.data_object.currentSolver = null;
priv.data_object.currentEditor.setContent(data);
priv.loading_object.save();
conflict_object.solveConflict(
......@@ -731,7 +739,6 @@
that.getList();
if (error.conflict_object) {
priv.onConflict (error.conflict_object);
// TODO : same for remove method
}
}
});
......
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