From b43ef65eb1de1a74d783a7f0d8fcca4b98332c6e Mon Sep 17 00:00:00 2001 From: niphlod Date: Thu, 16 Oct 2014 21:08:55 +0200 Subject: [PATCH] while we wait for a sane "prefixing", use a much more efficient way to find errors This comes from an unfortunate choice of naming conventions and the fact that manage errors gets called even on the full document on page load. I had a table full of .error-"classed" elements and it took nearly 30 seconds for that snippet to hide and fade them in. We should definitevely prefix every css class with something that won't clash with everything else. --- applications/admin/static/js/web2py.js | 2 +- applications/examples/static/js/web2py.js | 2 +- applications/welcome/static/js/web2py.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/admin/static/js/web2py.js b/applications/admin/static/js/web2py.js index ffb6baa8..5d77dfb1 100644 --- a/applications/admin/static/js/web2py.js +++ b/applications/admin/static/js/web2py.js @@ -141,7 +141,7 @@ }, /* manage errors in forms */ manage_errors: function(target) { - $('.error', target).hide().slideDown('slow'); + $('div.error', target).hide().slideDown('slow'); }, after_ajax: function(xhr) { /* called whenever an ajax request completes */ diff --git a/applications/examples/static/js/web2py.js b/applications/examples/static/js/web2py.js index ffb6baa8..5d77dfb1 100644 --- a/applications/examples/static/js/web2py.js +++ b/applications/examples/static/js/web2py.js @@ -141,7 +141,7 @@ }, /* manage errors in forms */ manage_errors: function(target) { - $('.error', target).hide().slideDown('slow'); + $('div.error', target).hide().slideDown('slow'); }, after_ajax: function(xhr) { /* called whenever an ajax request completes */ diff --git a/applications/welcome/static/js/web2py.js b/applications/welcome/static/js/web2py.js index ffb6baa8..5d77dfb1 100644 --- a/applications/welcome/static/js/web2py.js +++ b/applications/welcome/static/js/web2py.js @@ -141,7 +141,7 @@ }, /* manage errors in forms */ manage_errors: function(target) { - $('.error', target).hide().slideDown('slow'); + $('div.error', target).hide().slideDown('slow'); }, after_ajax: function(xhr) { /* called whenever an ajax request completes */