summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-27 12:22:29 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-27 12:22:29 +0100
commit67c1a0a951403a546250ea860a3e3d199cae2fce (patch)
treef86ec6cedf081a1a57005eca1661e9bead34e4de /app/assets
parent5d8ce5f4775ac8bc5f523964e6e36f63ff3c4683 (diff)
parent211f558a86ae30cdd5b392ab1376e1393f97e22c (diff)
Merge branch 'develop'5.1-beta6
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/forms.js.coffee11
-rw-r--r--app/assets/stylesheets/gemeinschaft-generic.css.scss22
2 files changed, 33 insertions, 0 deletions
diff --git a/app/assets/javascripts/forms.js.coffee b/app/assets/javascripts/forms.js.coffee
new file mode 100644
index 0000000..42b1c45
--- /dev/null
+++ b/app/assets/javascripts/forms.js.coffee
@@ -0,0 +1,11 @@
+# Simple Form Toggle for required fields
+$(document).ready ->
+ validate_fields = (obj)->
+ if ($(obj).val() == "")
+ $(obj).addClass "invalid"
+ else
+ $(obj).removeClass "invalid"
+
+ sel = "input.required, textarea.required"
+ $(sel).each (i, e)-> validate_fields(e)
+ $(sel).keyup -> validate_fields(this)
diff --git a/app/assets/stylesheets/gemeinschaft-generic.css.scss b/app/assets/stylesheets/gemeinschaft-generic.css.scss
index fbeaa1f..9448b84 100644
--- a/app/assets/stylesheets/gemeinschaft-generic.css.scss
+++ b/app/assets/stylesheets/gemeinschaft-generic.css.scss
@@ -25,6 +25,28 @@ li.display {
}
input, textarea, .uneditable-input {
width: 500px;
+ @media (max-width: 979px) {
+ width: 200px;
+ }
+ @media (max-width: 480px) {
+ width: 96%;
+ }
+}
+input, textarea {
+ &.invalid {
+ box-shadow: inset -9px 0px 0px rgb(255, 219, 219), inset -14px 0px 0px rgb(255, 245, 245) !important;
+ }
+}
+
+select {
+ width: 520px;
+ @media (max-width: 979px) {
+ width: 220px;
+ }
+ @media (max-width: 480px) {
+ width: 99.5%;
+ }
+
}
@media (max-width: 979px) {