|
|
@ -986,17 +986,23 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
Store.moveToTrash = function (clientId, data, cb) {
|
|
|
|
Store.moveToTrash = function (clientId, data, cb) {
|
|
|
|
var href = Hash.getRelativeHref(data.href);
|
|
|
|
var href = Hash.getRelativeHref(data.href);
|
|
|
|
|
|
|
|
var allErrors = true;
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
getAllStores().forEach(function (s) {
|
|
|
|
getAllStores().forEach(function (s) {
|
|
|
|
var deleted = s.userObject.forget(href);
|
|
|
|
var deleted = s.userObject.forget(href);
|
|
|
|
if (!deleted) { return; }
|
|
|
|
if (!deleted) { return; }
|
|
|
|
|
|
|
|
allErrors = false;
|
|
|
|
var send = s.id ? s.sendEvent : sendDriveEvent;
|
|
|
|
var send = s.id ? s.sendEvent : sendDriveEvent;
|
|
|
|
send('DRIVE_CHANGE', {
|
|
|
|
send('DRIVE_CHANGE', {
|
|
|
|
path: ['drive', UserObject.FILES_DATA]
|
|
|
|
path: ['drive', UserObject.FILES_DATA]
|
|
|
|
}, clientId);
|
|
|
|
}, clientId);
|
|
|
|
onSync(s.id, waitFor());
|
|
|
|
onSync(s.id, waitFor());
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}).nThen(cb);
|
|
|
|
}).nThen(function () {
|
|
|
|
|
|
|
|
cb({
|
|
|
|
|
|
|
|
error: allErrors ? 'FORBIDDEN' : undefined
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
Store.setPadTitle = function (clientId, data, cb) {
|
|
|
|
Store.setPadTitle = function (clientId, data, cb) {
|
|
|
|
var title = data.title;
|
|
|
|
var title = data.title;
|
|
|
|