From c6578fc54365ac743ae388b8d57122496aa79840 Mon Sep 17 00:00:00 2001 From: simbabque Date: Sun, 26 Feb 2017 15:05:48 +0100 Subject: [PATCH 1/3] make remove button on email and website work The removeLabel JS function seems to not be used at all any more. It operates on elements with the .control class, but that also seems not to be used at all. There are some references to that class in root/static/openlayers/OpenLayers.js, but I am not sure if that's related. Both the JS function as well as the corresponding less code in root/less/account.less can possibly be removed. --- root/account/profile.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/account/profile.html b/root/account/profile.html index a045cee54b..0c9585678a 100644 --- a/root/account/profile.html +++ b/root/account/profile.html @@ -294,7 +294,7 @@

Error

function addField(id) { var input = $('input[name="' + id + '"]').last(); var container = input.parent().parent(); - container.append('
'); + container.append('
'); var add = container.children().last(); add.slideDown(); return false; From 95ec4258471c6079010403f22aa3ffc917ffbd77 Mon Sep 17 00:00:00 2001 From: simbabque Date: Sun, 26 Feb 2017 15:09:42 +0100 Subject: [PATCH 2/3] fix horizontal spacing for repeatable fields --- root/account/profile.html | 2 +- root/static/less/account.less | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/root/account/profile.html b/root/account/profile.html index 0c9585678a..b38696d679 100644 --- a/root/account/profile.html +++ b/root/account/profile.html @@ -294,7 +294,7 @@

Error

function addField(id) { var input = $('input[name="' + id + '"]').last(); var container = input.parent().parent(); - container.append('
'); + container.append('
'); var add = container.children().last(); add.slideDown(); return false; diff --git a/root/static/less/account.less b/root/static/less/account.less index 192806f1ae..a60c813aa2 100644 --- a/root/static/less/account.less +++ b/root/static/less/account.less @@ -56,6 +56,16 @@ } } + .repeatable .form-group { + .input-group { + margin-bottom: 15px; + } + + &:last-child { + margin-bottom: 0; + } + } + // The last-updated text needs better alignment p.checkbox { padding-left: 0; From 7e2baa45614c091f306627886731e3fa9e5267bd Mon Sep 17 00:00:00 2001 From: simbabque Date: Sun, 26 Feb 2017 15:25:51 +0100 Subject: [PATCH 3/3] make sure all buttons never behabve like submit Some browsers apparently think that a button is a submit-like button by default. If there's JS on that button, it gets executed when one presses enter in the form. It seems to pick the first button to occur. This only happens in some browsers, and lead to additional email rows being added whenever enter was pressed in any form field. Also see http://stackoverflow.com/a/13534643/1331451. This changes the behavior insofar that now whenever enter is pressed, the form is submitted and the profile gets saved. Fixes #1847 --- root/account/profile.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/root/account/profile.html b/root/account/profile.html index b38696d679..5971c57777 100644 --- a/root/account/profile.html +++ b/root/account/profile.html @@ -52,14 +52,14 @@

Error

- +
<% FOREACH email IN author.email -%>
- +
<% END -%> @@ -73,7 +73,7 @@

Error

- +
<% FOREACH website IN author.website -%> @@ -81,7 +81,7 @@

Error

- +
<% END -%> @@ -294,7 +294,7 @@

Error

function addField(id) { var input = $('input[name="' + id + '"]').last(); var container = input.parent().parent(); - container.append('
'); + container.append('
'); var add = container.children().last(); add.slideDown(); return false;