← Back to team overview

schooltool-developers team mailing list archive

Re: Gradebook popup menu

 

--- On Fri, 6/3/11, Alan Elkner <aelkner@xxxxxxxxx> wrote:

> I attached a screentshot of the updated menu.  As
> always, any comments
> are welcome.

Just a few comments:

- I rather use "display: none;" to "visibility: hidden;" for cases like this. Visually the absolute positioning makes them look like the same, but jQuery provides methods like .show() and .hide() which use the display property. You can read more about the "visual" difference here: http://webdesign.about.com/od/examples/l/blfaqhidden.htm

- In the case where you show one menu and hide others, CSS classes work better than moving the id around. Again, jQuery provides .addClass() and .removeClass() methods that makes this easy.

- Don't forget ";" at the end of your JavaScript lines ;) Sometimes I paste my code in http://www.jslint.com/ to check the syntax.

- You can remove most of that JavaScript logic (assignments, comparison, etc) using jQuery. I wrote a smaller version of the JS code and pushed it to:

lp:~replaceafill/schooltool.gradebook/popup_menu

A little advantage of this approach is that you can click an action button even if a popup menu is activated. I think that's not possible in your implementation.

Douglas

"... allí­ es cuando te das cuenta que las cosas malas pueden resultar bastante buenas..." - Lionel Messi

Por favor, evite enviarme adjuntos de Word, Excel o PowerPoint.
Vea http://www.gnu.org/philosophy/no-word-attachments.es.html




References