summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-09-21 11:22:22 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-21 11:22:22 +0200
commitd7d3e8d80245a671f531de2fd765523322647032 (patch)
tree2288a945a1e859a72bfde658d79d6bdac0128684 /apps/files_external
parentc5f0ad49b0921cba7285cf134960d72c0034c141 (diff)
parent624f5de67af852657d424ea7720a441aca077e09 (diff)
downloadnextcloud-server-d7d3e8d80245a671f531de2fd765523322647032.tar.gz
nextcloud-server-d7d3e8d80245a671f531de2fd765523322647032.zip
Merge pull request #19176 from owncloud/fix-19118
Fix checkboxes in files_external
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/js/settings.js7
-rw-r--r--apps/files_external/templates/settings.php16
2 files changed, 12 insertions, 11 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index bf9981adabf..4319677f4f4 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -15,12 +15,12 @@ var MOUNT_OPTIONS_DROPDOWN_TEMPLATE =
'<div class="drop dropdown mountOptionsDropdown">' +
// FIXME: options are hard-coded for now
' <div class="optionRow">' +
- ' <label for="mountOptionsEncrypt">{{t "files_external" "Enable encryption"}}</label>' +
' <input id="mountOptionsEncrypt" name="encrypt" type="checkbox" value="true" checked="checked"/>' +
+ ' <label for="mountOptionsEncrypt">{{t "files_external" "Enable encryption"}}</label>' +
' </div>' +
' <div class="optionRow">' +
- ' <label for="mountOptionsPreviews">{{t "files_external" "Enable previews"}}</label>' +
' <input id="mountOptionsPreviews" name="previews" type="checkbox" value="true" checked="checked"/>' +
+ ' <label for="mountOptionsPreviews">{{t "files_external" "Enable previews"}}</label>' +
' </div>' +
' <div class="optionRow">' +
' <label for="mountOptionsFilesystemCheck">{{t "files_external" "Check for changes"}}</label>' +
@@ -808,7 +808,8 @@ MountConfigListView.prototype = _.extend({
if (placeholder.indexOf('*') === 0) {
newElement = $('<input type="password" class="'+classes.join(' ')+'" data-parameter="'+parameter+'" placeholder="'+placeholder.substring(1)+'" />');
} else if (placeholder.indexOf('!') === 0) {
- newElement = $('<label><input type="checkbox" class="'+classes.join(' ')+'" data-parameter="'+parameter+'" />'+placeholder.substring(1)+'</label>');
+ var checkboxId = _.uniqueId('checkbox_');
+ newElement = $('<input type="checkbox" id="'+checkboxId+'" class="'+classes.join(' ')+'" data-parameter="'+parameter+'" /><label for="'+checkboxId+'">'+placeholder.substring(1)+'</label>');
} else if (placeholder.indexOf('#') === 0) {
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 63a3a19de2f..7762ff60333 100644
--- a/apps/files_external/templates/settings.php
+++ b/apps/files_external/templates/settings.php
@@ -23,14 +23,14 @@
<?php
break;
case DefinitionParameter::VALUE_BOOLEAN: ?>
- <label>
- <input type="checkbox"
- <?php if (!empty($classes)): ?> class="<?php p(implode(' ', $classes)); ?>"<?php endif; ?>
- data-parameter="<?php p($parameter->getName()); ?>"
- <?php if ($value === true): ?> checked="checked"<?php endif; ?>
- />
- <?php p($placeholder); ?>
- </label>
+ <?php $checkboxId = uniqid("checkbox_"); ?>
+ <input type="checkbox"
+ id="<?php p($checkboxId); ?>"
+ <?php if (!empty($classes)): ?> class="<?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
break;
case DefinitionParameter::VALUE_HIDDEN: ?>