changeset abd0f9c8584f in sao:6.2
details: https://hg.tryton.org/sao?cmd=changeset&node=abd0f9c8584f
description:
Show PYSON feedback when input has the focus
We must insert the accesskey span after the feedback element as the
Bootstrap
rule is based on direct sibling.
And we must set a z-index value at least identical to the z-index of
the input
inside an input-group.
issue11076
review376261002
(grafted from e639d87b9e241550d5912c41782b4c1fb0af8bdb)
diffstat:
src/sao.less | 10 +++++++---
src/theme.less | 6 ++++++
src/view/form.js | 2 +-
3 files changed, 14 insertions(+), 4 deletions(-)
diffs (69 lines):
diff -r eda68ca2af75 -r abd0f9c8584f src/sao.less
--- a/src/sao.less Sat Jan 01 17:33:02 2022 +0100
+++ b/src/sao.less Wed Dec 29 12:29:19 2021 +0100
@@ -47,6 +47,10 @@
text-overflow: ellipsis;
}
+.input-group > .form-control-feedback {
+ z-index: 3;
+}
+
.navbar-inverse {
.close {
color: @navbar-inverse-link-color;
@@ -194,7 +198,7 @@
html.accesskey {
- *[accesskey]+span[data-accesskey]:after,
+ *[accesskey] ~ span[data-accesskey]:after,
*[accesskey]:after {
background-color: @brand-info;
color: #fff;
@@ -210,7 +214,7 @@
background-color: initial;
}
- *[accesskey]+span[data-accesskey] {
+ *[accesskey] ~ span[data-accesskey] {
float: right;
position: relative;
@@ -226,7 +230,7 @@
input[accesskey][type="checkbox"],
input[accesskey][type="checkbox"],
select[accesskey] {
- &+span[data-accesskey] {
+ & ~ span[data-accesskey] {
bottom: 1em;
}
}
diff -r eda68ca2af75 -r abd0f9c8584f src/theme.less
--- a/src/theme.less Sat Jan 01 17:33:02 2022 +0100
+++ b/src/theme.less Wed Dec 29 12:29:19 2021 +0100
@@ -149,6 +149,12 @@
padding: 0 5px;
}
+.has-feedback {
+ .form-control {
+ padding-right: (@input-height-base * 1.25);
+ }
+}
+
.input-group-addon {
background-color: transparent;
border: transparent;
diff -r eda68ca2af75 -r abd0f9c8584f src/view/form.js
--- a/src/view/form.js Sat Jan 01 17:33:02 2022 +0100
+++ b/src/view/form.js Wed Dec 29 12:29:19 2021 +0100
@@ -112,7 +112,7 @@
widget.labelled.get(0).tagName)) {
jQuery('<span/>', {
'data-accesskey': accesskey,
- }).insertAfter(widget.labelled);
+ }).appendTo(widget.labelled.parent());
}
label.label_el.attr('for', widget.labelled.attr('id'));
}