|
|
@ -3005,7 +3005,7 @@ define([
|
|
|
|
var pathsList = [];
|
|
|
|
var pathsList = [];
|
|
|
|
var type = $contextMenu.attr('data-menu-type');
|
|
|
|
var type = $contextMenu.attr('data-menu-type');
|
|
|
|
|
|
|
|
|
|
|
|
var el;
|
|
|
|
var el, data;
|
|
|
|
if (paths.length === 0) {
|
|
|
|
if (paths.length === 0) {
|
|
|
|
log(Messages.fm_forbidden);
|
|
|
|
log(Messages.fm_forbidden);
|
|
|
|
debug("Context menu on a forbidden or unexisting element. ", paths);
|
|
|
|
debug("Context menu on a forbidden or unexisting element. ", paths);
|
|
|
@ -3050,7 +3050,7 @@ define([
|
|
|
|
else if ($(this).hasClass('cp-app-drive-context-share')) {
|
|
|
|
else if ($(this).hasClass('cp-app-drive-context-share')) {
|
|
|
|
if (paths.length !== 1) { return; }
|
|
|
|
if (paths.length !== 1) { return; }
|
|
|
|
el = manager.find(paths[0].path);
|
|
|
|
el = manager.find(paths[0].path);
|
|
|
|
var data, parsed, modal;
|
|
|
|
var parsed, modal;
|
|
|
|
if (manager.isSharedFolder(el)) {
|
|
|
|
if (manager.isSharedFolder(el)) {
|
|
|
|
data = manager.getSharedFolderData(el);
|
|
|
|
data = manager.getSharedFolderData(el);
|
|
|
|
parsed = Hash.parsePadUrl(data.href);
|
|
|
|
parsed = Hash.parsePadUrl(data.href);
|
|
|
@ -3065,11 +3065,10 @@ define([
|
|
|
|
data = manager.getFileData(el);
|
|
|
|
data = manager.getFileData(el);
|
|
|
|
parsed = Hash.parsePadUrl(data.href);
|
|
|
|
parsed = Hash.parsePadUrl(data.href);
|
|
|
|
var roParsed = Hash.parsePadUrl(data.roHref);
|
|
|
|
var roParsed = Hash.parsePadUrl(data.roHref);
|
|
|
|
var type = parsed.type || roParsed.type;
|
|
|
|
var padType = parsed.type || roParsed.type;
|
|
|
|
console.log(parsed);
|
|
|
|
|
|
|
|
var padData = {
|
|
|
|
var padData = {
|
|
|
|
origin: APP.origin,
|
|
|
|
origin: APP.origin,
|
|
|
|
pathname: "/" + type + "/",
|
|
|
|
pathname: "/" + padType + "/",
|
|
|
|
hashes: {
|
|
|
|
hashes: {
|
|
|
|
editHash: parsed.hash,
|
|
|
|
editHash: parsed.hash,
|
|
|
|
viewHash: roParsed.hash,
|
|
|
|
viewHash: roParsed.hash,
|
|
|
@ -3081,7 +3080,7 @@ define([
|
|
|
|
},
|
|
|
|
},
|
|
|
|
common: common
|
|
|
|
common: common
|
|
|
|
};
|
|
|
|
};
|
|
|
|
modal = type === 'file' ? UIElements.createFileShareModal(padData)
|
|
|
|
modal = padType === 'file' ? UIElements.createFileShareModal(padData)
|
|
|
|
: UIElements.createShareModal(padData);
|
|
|
|
: UIElements.createShareModal(padData);
|
|
|
|
modal = UI.dialog.tabs(modal);
|
|
|
|
modal = UI.dialog.tabs(modal);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3133,7 +3132,7 @@ define([
|
|
|
|
else if ($(this).hasClass("cp-app-drive-context-hashtag")) {
|
|
|
|
else if ($(this).hasClass("cp-app-drive-context-hashtag")) {
|
|
|
|
if (paths.length !== 1) { return; }
|
|
|
|
if (paths.length !== 1) { return; }
|
|
|
|
el = manager.find(paths[0].path);
|
|
|
|
el = manager.find(paths[0].path);
|
|
|
|
var data = manager.getFileData(el);
|
|
|
|
data = manager.getFileData(el);
|
|
|
|
if (!data) { return void console.error("Expected to find a file"); }
|
|
|
|
if (!data) { return void console.error("Expected to find a file"); }
|
|
|
|
var href = data.href || data.roHref;
|
|
|
|
var href = data.href || data.roHref;
|
|
|
|
common.updateTags(href);
|
|
|
|
common.updateTags(href);
|
|
|
|