]> source.dussan.org Git - nextcloud-server.git/commitdiff
files_external: Keep checkbox and its label on one line #20032 #22655
authorMarkus Goetz <markus@woboq.com>
Wed, 15 Jun 2016 13:24:01 +0000 (15:24 +0200)
committerMarkus Goetz <markus@woboq.com>
Fri, 17 Jun 2016 14:19:38 +0000 (16:19 +0200)
Else the checkbox and the decription end up on different lines in my Chrome on OS X

apps/files_external/js/settings.js
apps/files_external/templates/settings.php

index 2477f513db3d3862e234d72dc68e6163857e7afd..d210c158ec125885085ad04bb040bb3f154cb656 100644 (file)
@@ -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 {
index c9cc40b0ba07283adbf474b0a19970e7521765ae..6662f637039c5234e1284e7bc08cd2298071c281 100644 (file)
                        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: ?>