Hide disabled applications from the context menu in drive
This commit is contained in:
parent
91299f5f30
commit
2c6b4b9c6a
@ -4,7 +4,7 @@ define(function() {
|
|||||||
/* Select the buttons displayed on the main page to create new collaborative sessions
|
/* Select the buttons displayed on the main page to create new collaborative sessions
|
||||||
* Existing types : pad, code, poll, slide
|
* Existing types : pad, code, poll, slide
|
||||||
*/
|
*/
|
||||||
config.availablePadTypes = ['pad', 'code', 'slide', 'poll'];
|
config.availablePadTypes = ['drive', 'pad', 'code', 'slide', 'poll'];
|
||||||
|
|
||||||
/* Cryptpad apps use a common API to display notifications to users
|
/* Cryptpad apps use a common API to display notifications to users
|
||||||
* by default, notifications are hidden after 5 seconds
|
* by default, notifications are hidden after 5 seconds
|
||||||
|
|||||||
@ -54,6 +54,7 @@ define([
|
|||||||
var $parent = $('#buttons');
|
var $parent = $('#buttons');
|
||||||
var options = [];
|
var options = [];
|
||||||
Config.availablePadTypes.forEach(function (el) {
|
Config.availablePadTypes.forEach(function (el) {
|
||||||
|
if (el === 'drive') { return; }
|
||||||
options.push({
|
options.push({
|
||||||
tag: 'a',
|
tag: 'a',
|
||||||
attributes: {
|
attributes: {
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
define([
|
define([
|
||||||
'/customize/messages.js',
|
'/customize/messages.js',
|
||||||
|
'/customize/application_config.js',
|
||||||
'/bower_components/jquery/dist/jquery.min.js'
|
'/bower_components/jquery/dist/jquery.min.js'
|
||||||
], function (Messages) {
|
], function (Messages, Config) {
|
||||||
var $ = window.jQuery;
|
var $ = window.jQuery;
|
||||||
|
|
||||||
var Bar = {
|
var Bar = {
|
||||||
@ -349,7 +350,7 @@ define([
|
|||||||
|
|
||||||
if (config.displayed.indexOf('newpad') !== -1) {
|
if (config.displayed.indexOf('newpad') !== -1) {
|
||||||
var pads_options = [];
|
var pads_options = [];
|
||||||
['drive', 'pad', 'code', 'slide', 'poll'].forEach(function (p) {
|
Config.availablePadTypes.forEach(function (p) {
|
||||||
pads_options.push({
|
pads_options.push({
|
||||||
tag: 'a',
|
tag: 'a',
|
||||||
attributes: {
|
attributes: {
|
||||||
|
|||||||
@ -452,6 +452,12 @@ define([
|
|||||||
$menu.find('a.own').parent('li').hide();
|
$menu.find('a.own').parent('li').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$menu.find('[data-type]').each(function (idx, el) {
|
||||||
|
if (AppConfig.availablePadTypes.indexOf($(el).attr('data-type')) === -1) {
|
||||||
|
$(el).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$menu.css({
|
$menu.css({
|
||||||
display: "block",
|
display: "block",
|
||||||
left: e.pageX,
|
left: e.pageX,
|
||||||
@ -893,6 +899,7 @@ define([
|
|||||||
options.push({tag: 'hr'});
|
options.push({tag: 'hr'});
|
||||||
}
|
}
|
||||||
AppConfig.availablePadTypes.forEach(function (type) {
|
AppConfig.availablePadTypes.forEach(function (type) {
|
||||||
|
if (type === 'drive') { return; }
|
||||||
var path = filesOp.isPathInTrash(currentPath) ? '' : '/#?path=' + encodeURIComponent(currentPath);
|
var path = filesOp.isPathInTrash(currentPath) ? '' : '/#?path=' + encodeURIComponent(currentPath);
|
||||||
var attributes = {
|
var attributes = {
|
||||||
'class': 'newdoc',
|
'class': 'newdoc',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user