Should we drop $('.hidden', target).hide() from web2py.js?

51 views
Skip to first unread message

Anthony

unread,
Sep 17, 2015, 12:25:03 PM9/17/15
to web2py-developers
In ajax_init(), we have:

      ajax_init: function(target) {
       
/*called whenever a fragment gets loaded */
        $
('.hidden', target).hide();

Apparently this can cause problems in some cases (see https://groups.google.com/forum/#!topic/web2py/v-zcwPkHztk). If an element has a "hidden" class, presumably there is already some CSS to hide it, so why should we need to use jQuery?

Anthony

Leonel Câmara

unread,
Sep 17, 2015, 2:29:48 PM9/17/15
to web2py-developers
I would say yes. I would also say appadmin should stop using the hidden class on HTML elements as that depends on whether CSS is there for it or not.

Niphlod

unread,
Sep 17, 2015, 3:05:56 PM9/17/15
to web2py-developers
a better approach would be to use '.w2p_hidden' with the relevant style in scaffolding css and change whatever '.hidden' reference there is in core code and in web2py.js to accomodate every css framework.

Anthony

unread,
Sep 17, 2015, 3:23:01 PM9/17/15
to web2py-developers
Agreed. Maybe we should also change .flash to .w2p_flash, just to avoid any possible collisions with other front end frameworks.

Anthony

Niphlod

unread,
Sep 17, 2015, 4:33:00 PM9/17/15
to web2py-developers
+1. maybe record a bug, I can work on it on the weekend if nobody wants to make a jump at it. My "web2py backorders" list is getting huge :-(

Anthony

unread,
Sep 17, 2015, 5:57:12 PM9/17/15
to web2py-developers

Niphlod

unread,
Sep 21, 2015, 3:43:25 PM9/21/15
to web2py-developers
done, plus a few things.

BTW: checked out the scaffolding.... as it was it was completely screwed with inline forms: don't know how it's gone unnoticed.
Fixed it, fixed the theme, threw in a better "widget" repr for list:strings .
Reply all
Reply to author
Forward
0 new messages