aboutsummaryrefslogtreecommitdiffstats
path: root/web/js
diff options
context:
space:
mode:
authorDave Whiteland <dave@mysociety.org>2013-08-07 16:32:31 +0100
committerDave Whiteland <dave@mysociety.org>2013-09-05 17:31:06 +0100
commitf574cd68ac232364ca0d09b95d9f709cd37ad0a5 (patch)
tree9307890e5baf0cf973ee8b81101d09907c1bf713 /web/js
parent1105cd1f0df1de0569d9f1530a86c21ca34ea775 (diff)
don't hide with slideUp on page load
if open311 shouldn't be show, hide it straight away (slideUp animation was distracting)
Diffstat (limited to 'web/js')
-rw-r--r--web/js/fixmystreet-admin.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/web/js/fixmystreet-admin.js b/web/js/fixmystreet-admin.js
index 27be7f14d..a65fa3650 100644
--- a/web/js/fixmystreet-admin.js
+++ b/web/js/fixmystreet-admin.js
@@ -4,7 +4,7 @@ $(function(){
// hide the open311_only section and reveal it only when send_method is relevant
var $open311_only = $('.admin-open311-only');
if ($open311_only) {
- function hide_or_show_open311() {
+ function hide_or_show_open311(hide_fast) {
var send_method = $('#send_method').val();
var show_open311 = false;
if ($('#endpoint').val()) {
@@ -12,14 +12,18 @@ $(function(){
} else if (send_method && send_method.toLowerCase() != 'email') {
show_open311 = true;
}
- if (show_open311) {
- $open311_only.slideDown();
- } else {
- $open311_only.slideUp();
+ if (show_open311) {
+ $open311_only.slideDown();
+ } else {
+ if (hide_fast) {
+ $open311_only.hide();
+ } else {
+ $open311_only.slideUp();
+ }
}
}
$('#send_method').on('change', hide_or_show_open311);
- hide_or_show_open311();
+ hide_or_show_open311(true);
}
// admin hints: maybe better implemented as tooltips?