Disable moveToTrash button for pads in shared folders
This commit is contained in:
@@ -691,8 +691,18 @@ define([
|
||||
};
|
||||
|
||||
// Pads
|
||||
Store.isOnlyInSharedFolder = function (clientId, channel, cb) {
|
||||
var res = store.manager.findChannel(channel);
|
||||
|
||||
// A pad is only in a shared worker if:
|
||||
// 1. this pad is in at least one proxy
|
||||
// 2. no proxy containing this pad is the main drive
|
||||
return cb (res.length && !res.some(function (obj) {
|
||||
// Main drive doesn't have an fId (folder ID)
|
||||
return !obj.fId;
|
||||
}));
|
||||
};
|
||||
Store.moveToTrash = function (clientId, data, cb) {
|
||||
// XXX move a pad from a shared folder to the trash?
|
||||
var href = Hash.getRelativeHref(data.href);
|
||||
store.userObject.forget(href);
|
||||
sendDriveEvent('DRIVE_CHANGE', {
|
||||
|
||||
@@ -41,6 +41,7 @@ define([
|
||||
MOVE_TO_TRASH: Store.moveToTrash,
|
||||
RESET_DRIVE: Store.resetDrive,
|
||||
GET_METADATA: Store.getMetadata,
|
||||
IS_ONLY_IN_SHARED_FOLDER: Store.isOnlyInSharedFolder,
|
||||
SET_DISPLAY_NAME: Store.setDisplayName,
|
||||
SET_PAD_ATTRIBUTE: Store.setPadAttribute,
|
||||
GET_PAD_ATTRIBUTE: Store.getPadAttribute,
|
||||
|
||||
Reference in New Issue
Block a user