diff --git a/apps/settings/css/settings.scss b/apps/settings/css/settings.scss index 7b90a261c9..3b2e1fb78c 100644 --- a/apps/settings/css/settings.scss +++ b/apps/settings/css/settings.scss @@ -372,6 +372,18 @@ select { font-weight: bold; } } + + &.disabled { + /* !important is needed to override important opacity of + * ".popovermenu li > .menuitem.active" */ + opacity: .5 !important; + + cursor: default; + + span { + cursor: default; + } + } } } } diff --git a/apps/settings/js/federationscopemenu.js b/apps/settings/js/federationscopemenu.js index a2ca77bbf8..381ab1164b 100644 --- a/apps/settings/js/federationscopemenu.js +++ b/apps/settings/js/federationscopemenu.js @@ -117,6 +117,17 @@ break; } + var lookupServerUploadEnabled = $('#lookupServerUploadEnabled').val(); + if (!lookupServerUploadEnabled && !this._scopes[2].active) { + this._scopes[2].hidden = true + } else if (!lookupServerUploadEnabled && this._scopes[2].active) { + this._scopes[2].hidden = false + this._scopes[2].disabled = true + } else { + this._scopes[2].hidden = false + this._scopes[2].disabled = false + } + this.render(); this.$el.removeClass('hidden'); diff --git a/apps/settings/js/templates.js b/apps/settings/js/templates.js index 25c2e79004..2cd8179f3e 100644 --- a/apps/settings/js/templates.js +++ b/apps/settings/js/templates.js @@ -1,6 +1,15 @@ (function() { var template = Handlebars.template, templates = OC.Settings.Templates = OC.Settings.Templates || {}; templates['federationscopemenu'] = template({"1":function(container,depth0,helpers,partials,data) { + var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined + }; + + return ((stack1 = lookupProperty(helpers,"unless").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"hidden") : depth0),{"name":"unless","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":2},"end":{"line":25,"column":13}}})) != null ? stack1 : ""); +},"2":function(container,depth0,helpers,partials,data) { var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) { if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { return parent[propertyName]; @@ -8,22 +17,49 @@ templates['federationscopemenu'] = template({"1":function(container,depth0,helpe return undefined }; - return "
\n "
- + alias4(((helper = (helper = lookupProperty(helpers,"displayName") || (depth0 != null ? lookupProperty(depth0,"displayName") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"displayName","hash":{},"data":data,"loc":{"start":{"line":11,"column":35},"end":{"line":11,"column":50}}}) : helper)))
+ + alias4(((helper = (helper = lookupProperty(helpers,"displayName") || (depth0 != null ? lookupProperty(depth0,"displayName") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"displayName","hash":{},"data":data,"loc":{"start":{"line":16,"column":35},"end":{"line":16,"column":50}}}) : helper)))
+ "
\n \n