[PATCH v2] [Wok] Added disabled and readonly states to Bootstrap Select

From: samhenri <samuel.guimaraes@eldorado.org.br> This patch fixes readonly and disabled states for Bootstrap Select elements initialized by selectpicker() in the UI. You can spot this changes in action when editing a Template if you apply "Fixed minor UI issues when saving edited template". v2 - Included correct files + compiled CSS file samhenri (1): Added disabled and readonly states to Bootstrap Select ui/css/bootstrap-select.custom.css | 28 ++++++++++++++++++++++++++++ ui/css/src/bootstrap-select.custom.scss | 18 ++++++++++++++++++ 2 files changed, 46 insertions(+) -- 1.9.3

From: samhenri <samuel.guimaraes@eldorado.org.br> Signed-off-by: samhenri <samuel.guimaraes@eldorado.org.br> --- ui/css/bootstrap-select.custom.css | 28 ++++++++++++++++++++++++++++ ui/css/src/bootstrap-select.custom.scss | 18 ++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/ui/css/bootstrap-select.custom.css b/ui/css/bootstrap-select.custom.css index fc4a936..f119b1c 100644 --- a/ui/css/bootstrap-select.custom.css +++ b/ui/css/bootstrap-select.custom.css @@ -57,6 +57,34 @@ border-left-color: #8c8c8c; } +.bootstrap-select.btn-group > [disabled], +.bootstrap-select.btn-group > [disabled]:hover, +.bootstrap-select.btn-group > [disabled]:focus, +.bootstrap-select.btn-group > [readonly], +.bootstrap-select.btn-group > [readonly]:hover, +.bootstrap-select.btn-group > [readonly]:focus, +.bootstrap-select.btn-group > .disabled, +.bootstrap-select.btn-group > .disabled:hover, +.bootstrap-select.btn-group > .disabled:focus { + opacity: 1; + border-color: #ccc; + background-color: #eee; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.bootstrap-select.btn-group > [disabled] .caret, +.bootstrap-select.btn-group > [disabled]:hover .caret, +.bootstrap-select.btn-group > [disabled]:focus .caret, +.bootstrap-select.btn-group > [readonly] .caret, +.bootstrap-select.btn-group > [readonly]:hover .caret, +.bootstrap-select.btn-group > [readonly]:focus .caret, +.bootstrap-select.btn-group > .disabled .caret, +.bootstrap-select.btn-group > .disabled:hover .caret, +.bootstrap-select.btn-group > .disabled:focus .caret { + border-color: #ccc; +} + .bootstrap-select.btn-group .dropdown-menu { z-index: 2035; } diff --git a/ui/css/src/bootstrap-select.custom.scss b/ui/css/src/bootstrap-select.custom.scss index 5667dfd..cfac637 100644 --- a/ui/css/src/bootstrap-select.custom.scss +++ b/ui/css/src/bootstrap-select.custom.scss @@ -59,6 +59,24 @@ border-left-color: darken($btn-default-border, 25%); } } + > [disabled], + > [disabled]:hover, + > [disabled]:focus, + > [readonly], + > [readonly]:hover, + > [readonly]:focus, + > .disabled, + > .disabled:hover, + > .disabled:focus { + opacity: 1; + border-color: $btn-default-border; + background-color: $input-bg-disabled; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + .caret { + border-color: $btn-default-border; + } + } .dropdown-menu { z-index: 2035; } -- 1.9.3

Reviewed-by: Lucio Correia <luciojhc@linux.vnet.ibm.com> Tested-by: Lucio Correia <luciojhc@linux.vnet.ibm.com> On 04-01-2016 16:34, sguimaraes943@gmail.com wrote:
From: samhenri <samuel.guimaraes@eldorado.org.br>
Signed-off-by: samhenri <samuel.guimaraes@eldorado.org.br> --- ui/css/bootstrap-select.custom.css | 28 ++++++++++++++++++++++++++++ ui/css/src/bootstrap-select.custom.scss | 18 ++++++++++++++++++ 2 files changed, 46 insertions(+)
diff --git a/ui/css/bootstrap-select.custom.css b/ui/css/bootstrap-select.custom.css index fc4a936..f119b1c 100644 --- a/ui/css/bootstrap-select.custom.css +++ b/ui/css/bootstrap-select.custom.css @@ -57,6 +57,34 @@ border-left-color: #8c8c8c; }
+.bootstrap-select.btn-group > [disabled], +.bootstrap-select.btn-group > [disabled]:hover, +.bootstrap-select.btn-group > [disabled]:focus, +.bootstrap-select.btn-group > [readonly], +.bootstrap-select.btn-group > [readonly]:hover, +.bootstrap-select.btn-group > [readonly]:focus, +.bootstrap-select.btn-group > .disabled, +.bootstrap-select.btn-group > .disabled:hover, +.bootstrap-select.btn-group > .disabled:focus { + opacity: 1; + border-color: #ccc; + background-color: #eee; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.bootstrap-select.btn-group > [disabled] .caret, +.bootstrap-select.btn-group > [disabled]:hover .caret, +.bootstrap-select.btn-group > [disabled]:focus .caret, +.bootstrap-select.btn-group > [readonly] .caret, +.bootstrap-select.btn-group > [readonly]:hover .caret, +.bootstrap-select.btn-group > [readonly]:focus .caret, +.bootstrap-select.btn-group > .disabled .caret, +.bootstrap-select.btn-group > .disabled:hover .caret, +.bootstrap-select.btn-group > .disabled:focus .caret { + border-color: #ccc; +} + .bootstrap-select.btn-group .dropdown-menu { z-index: 2035; } diff --git a/ui/css/src/bootstrap-select.custom.scss b/ui/css/src/bootstrap-select.custom.scss index 5667dfd..cfac637 100644 --- a/ui/css/src/bootstrap-select.custom.scss +++ b/ui/css/src/bootstrap-select.custom.scss @@ -59,6 +59,24 @@ border-left-color: darken($btn-default-border, 25%); } } + > [disabled], + > [disabled]:hover, + > [disabled]:focus, + > [readonly], + > [readonly]:hover, + > [readonly]:focus, + > .disabled, + > .disabled:hover, + > .disabled:focus { + opacity: 1; + border-color: $btn-default-border; + background-color: $input-bg-disabled; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + .caret { + border-color: $btn-default-border; + } + } .dropdown-menu { z-index: 2035; }
-- Lucio Correia Software Engineer IBM LTC Brazil

On 04-01-2016 16:34, sguimaraes943@gmail.com wrote:
From: samhenri <samuel.guimaraes@eldorado.org.br>
This patch fixes readonly and disabled states for Bootstrap Select elements initialized by selectpicker() in the UI. You can spot this changes in action when editing a Template if you apply "Fixed minor UI issues when saving edited template".
v2 - Included correct files + compiled CSS file
Hi Samuel, I'm still unable to spot any difference with this patch. What are the expected changes? Thanks, -- Lucio Correia Software Engineer IBM LTC Brazil

Hi, You can add a disabled class to any button with .selectpicker class or add "disabled" / "readonly" attribute. For now it only works with Edit Templates but I'm planning to add to Edit Guests once I finish other minor issues. Check the attached screenshot. If somehow the selectpicker is still white with "not-allowed" cursor you'll have to clean your cache because the v2 includes the compiled CSS file. Thanks, Samuel -----Original Message----- From: kimchi-devel-bounces@ovirt.org [mailto:kimchi-devel-bounces@ovirt.org] On Behalf Of Lucio Correia Sent: segunda-feira, 4 de janeiro de 2016 17:10 To: kimchi-devel@ovirt.org Subject: Re: [Kimchi-devel] [PATCH v2] [Wok] Added disabled and readonly states to Bootstrap Select On 04-01-2016 16:34, sguimaraes943@gmail.com wrote:
From: samhenri <samuel.guimaraes@eldorado.org.br>
This patch fixes readonly and disabled states for Bootstrap Select elements initialized by selectpicker() in the UI. You can spot this changes in action when editing a Template if you apply "Fixed minor UI issues when saving edited template".
v2 - Included correct files + compiled CSS file
Hi Samuel, I'm still unable to spot any difference with this patch. What are the expected changes? Thanks, -- Lucio Correia Software Engineer IBM LTC Brazil _______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

Patch applied to the master branch of https://github.com/danielhb/wok.git Thanks! On 01/04/2016 04:34 PM, sguimaraes943@gmail.com wrote:
From: samhenri <samuel.guimaraes@eldorado.org.br>
This patch fixes readonly and disabled states for Bootstrap Select elements initialized by selectpicker() in the UI. You can spot this changes in action when editing a Template if you apply "Fixed minor UI issues when saving edited template".
v2 - Included correct files + compiled CSS file
samhenri (1): Added disabled and readonly states to Bootstrap Select
ui/css/bootstrap-select.custom.css | 28 ++++++++++++++++++++++++++++ ui/css/src/bootstrap-select.custom.scss | 18 ++++++++++++++++++ 2 files changed, 46 insertions(+)
participants (5)
-
Aline Manera
-
Daniel Henrique Barboza
-
Lucio Correia
-
Samuel Henrique De Oliveira Guimaraes
-
sguimaraes943@gmail.com