NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Commit

[Web] Highlight select boxes with missing required attrs

9d0d8263
andryyy <[email protected]> 6 years ago
data/web/css/build/008-mailcow.css | 10 ++++++++++
 data/web/js/build/012-api.js       | 12 ++++++++++++
 2 files changed, 22 insertions(+)

Diff

diff --git a/data/web/css/build/008-mailcow.css b/data/web/css/build/008-mailcow.css
index 0f0fc462..717b4d11 100644
--- a/data/web/css/build/008-mailcow.css
+++ b/data/web/css/build/008-mailcow.css
@@ -187,3 +187,13 @@ nav .glyphicon {
   border-bottom:1px solid #f5f5f5!important;
   opacity: 0.3;
 }
+.btn-input-missing,
+.btn-input-missing:hover,
+.btn-input-missing:active,
+.btn-input-missing:focus,
+.btn-input-missing:active:hover,
+.btn-input-missing:active:focus {
+  color: #000 !important;
+  background-color: #ff4136;
+  border-color: #ff291c;
+}
diff --git a/data/web/js/build/012-api.js b/data/web/js/build/012-api.js
index b0808590..d979a9b1 100644
--- a/data/web/js/build/012-api.js
+++ b/data/web/js/build/012-api.js
@@ -107,8 +107,14 @@ $(document).ready(function() {
         if ($(this).prop('required')) {
           if (!$(this).val() && $(this).prop('disabled') === false) {
             invalid = true;
+            if ($(this).is("select")) {
+              $(this).selectpicker('setStyle', 'btn-input-missing', 'add');
+            }
             $(this).addClass('inputMissingAttr');
           } else {
+            if ($(this).is("select")) {
+              $(this).selectpicker('setStyle', 'btn-input-missing', 'remove');
+            }
             $(this).removeClass('inputMissingAttr');
           }
         }
@@ -219,8 +225,14 @@ $(document).ready(function() {
         if ($(this).prop('required')) {
           if (!$(this).val() && $(this).prop('disabled') === false) {
             invalid = true;
+            if ($(this).is("select")) {
+              $(this).selectpicker('setStyle', 'btn-input-missing', 'add');
+            }
             $(this).addClass('inputMissingAttr');
           } else {
+            if ($(this).is("select")) {
+              $(this).selectpicker('setStyle', 'btn-input-missing', 'remove');
+            }
             $(this).removeClass('inputMissingAttr');
           }
         }