Remove useless links in the context menu and properties for readonly pads in the drive

This commit is contained in:
yflory
2017-03-21 12:09:07 +01:00
parent 7afde2309d
commit 51033ab70a
2 changed files with 41 additions and 7 deletions

View File

@@ -81,6 +81,16 @@ define([
return typeof(element) === "string";
};
var isReadOnlyFile = exp.isReadOnlyFile = function (element) {
if (!isFile(element)) { return false; }
var parsed = Cryptpad.parsePadUrl(element);
if (!parsed) { return false; }
var hash = parsed.hash;
var pHash = Cryptpad.parseHash(hash);
if (pHash && !pHash.mode) { return; }
return pHash && pHash.mode === 'view';
};
var isFolder = exp.isFolder = function (element) {
return typeof(element) !== "string";
};