Maheshjayachandran / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

showElement is not well named #448

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If one does

goog.style.showElement(elem);

one would expect the element to be shown. Instead, it is hidden.

Original issue reported on code.google.com by edmundhu...@google.com on 11 Apr 2012 at 11:56

GoogleCodeExporter commented 9 years ago
toggleElement might make more sense?

Original comment by jrhe...@yelp.com on 12 Apr 2012 at 12:01

GoogleCodeExporter commented 9 years ago
hideElement?

Original comment by edmundhu...@google.com on 12 Apr 2012 at 12:01

GoogleCodeExporter commented 9 years ago
As a general rule, we promote boolean flags over two functions/methods.  In 
this case, showElement(flag) over showElement() and hideElement().

JsCompiler should be giving you warnings if you're forgetting the flag.

Original comment by nn...@google.com on 12 Apr 2012 at 12:07