[dev] Patch for open_colorpicker.js

Jason Rust jrust at rustyparts.com
Wed Dec 10 15:10:37 PST 2003


The attached patch makes it so that when the colorpicker is closed it
no longer takes up space.  It also doesn't go through the trouble of
re-making the color table if it's showing it for the second time.  Also
includes a few style fixes.  Tested in Mozilla & IE.

-Jason
-------------- next part --------------
Index: open_colorpicker.js
===================================================================
RCS file: /repository/horde/templates/javascript/open_colorpicker.js,v
retrieving revision 1.3
diff -r1.3 open_colorpicker.js
4,5c4,5
<     if (lay.style.visibility == 'visible') {
<         lay.style.visibility = 'hidden';
---
>     if (lay.style.display == 'block') {
>         lay.style.display = 'none';
10c10,16
<         lay.removeChild(lay.firstChild);
---
>         if (lay.firstChild.nodeType == 1) {
>             lay.style.display = 'block';
>             return false;
>         }
>         else {
>             lay.removeChild(lay.firstChild);
>         }
13,14c19,20
<     var table = document.createElement('TABLE');
<     var tbody = document.createElement('TBODY');
---
>     var table = document.createElement('table');
>     var tbody = document.createElement('tbody');
27c33
<         row = document.createElement('TR');
---
>         row = document.createElement('tr');
45,46c51
<     lay.style.visibility = 'visible';
< 
---
>     lay.style.display = 'block';
51c56
<     cell = document.createElement('TD');
---
>     cell = document.createElement('td');


More information about the dev mailing list