summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-20 10:00:25 +0200
committerGitHub <noreply@github.com>2016-06-20 10:00:25 +0200
commite3ddbeb7551031a16b7d8c2aabc6a346aa4af390 (patch)
treec3bc7031e024b1a7b1876838f5d11bcecbd8182a
parente2b0a0f18fdcae58c2db4d863dd230a219c64174 (diff)
parent111bd8e57d2ccb7e894e8c3d86daaed62b6fb618 (diff)
downloadnextcloud-server-e3ddbeb7551031a16b7d8c2aabc6a346aa4af390.tar.gz
nextcloud-server-e3ddbeb7551031a16b7d8c2aabc6a346aa4af390.zip
Merge pull request #25120 from owncloud/settings_fix_checkbox_newline
files_external: Keep checkbox and its label on one line
-rw-r--r--apps/files_external/js/settings.js4
-rw-r--r--apps/files_external/templates/settings.php6
2 files changed, 7 insertions, 3 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 2477f513db3..d210c158ec1 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -854,7 +854,7 @@ MountConfigListView.prototype = _.extend({
this.configureAuthMechanism($tr, storageConfig.authMechanism, onCompletion);
if (storageConfig.backendOptions) {
- $td.children().each(function() {
+ $td.find('input, select').each(function() {
var input = $(this);
var val = storageConfig.backendOptions[input.data('parameter')];
if (val !== undefined) {
@@ -1001,7 +1001,7 @@ MountConfigListView.prototype = _.extend({
newElement = $('<input type="password" class="'+classes.join(' ')+'" data-parameter="'+parameter+'" placeholder="'+ trimmedPlaceholder+'" />');
} else if (placeholder.type === MountConfigListView.ParameterTypes.BOOLEAN) {
var checkboxId = _.uniqueId('checkbox_');
- newElement = $('<input type="checkbox" id="'+checkboxId+'" class="'+classes.join(' ')+'" data-parameter="'+parameter+'" /><label for="'+checkboxId+'">'+ trimmedPlaceholder+'</label>');
+ newElement = $('<div><label><input type="checkbox" id="'+checkboxId+'" class="'+classes.join(' ')+'" data-parameter="'+parameter+'" />'+ trimmedPlaceholder+'</label></div>');
} else if (placeholder.type === MountConfigListView.ParameterTypes.HIDDEN) {
newElement = $('<input type="hidden" class="'+classes.join(' ')+'" data-parameter="'+parameter+'" />');
} else {
diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php
index c9cc40b0ba0..6662f637039 100644
--- a/apps/files_external/templates/settings.php
+++ b/apps/files_external/templates/settings.php
@@ -51,13 +51,17 @@
break;
case DefinitionParameter::VALUE_BOOLEAN: ?>
<?php $checkboxId = uniqid("checkbox_"); ?>
+ <div>
+ <label>
<input type="checkbox"
id="<?php p($checkboxId); ?>"
<?php if (!empty($classes)): ?> class="checkbox <?php p(implode(' ', $classes)); ?>"<?php endif; ?>
data-parameter="<?php p($parameter->getName()); ?>"
<?php if ($value === true): ?> checked="checked"<?php endif; ?>
/>
- <label for="<?php p($checkboxId); ?>"><?php p($placeholder); ?></label>
+ <?php p($placeholder); ?>
+ </label>
+ </div>
<?php
break;
case DefinitionParameter::VALUE_HIDDEN: ?>