Changeset 7126
- Timestamp:
- May 10, 2008, 6:31:08 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE/trunk/public_html/js/pne_decoration.js
r7029 r7126 74 74 var table = document.getElementById("mce_editor_color_table") 75 75 if (table) { 76 table.parentNode.removeChild(table); 76 if (table.style.display == 'none') { 77 table.style.display = 'block'; 78 Event.observe(document, 'mousedown', pne_mce_hide_color_table); 79 } else { 80 pne_mce_hide_color_table(); 81 } 77 82 return; 78 83 } 84 85 Event.observe(document, 'mousedown', pne_mce_hide_color_table); 79 86 80 87 var color = null; … … 90 97 91 98 var tbody = document.createElement("tbody"); 99 Element.addClassName(tbody, 'disabledHideColorTable'); 92 100 93 101 var tr; … … 98 106 if (i == 0 || i % settings.grid_width == 0) { 99 107 tr = document.createElement("tr"); 108 Element.addClassName(tr, 'disabledHideColorTable'); 100 109 tbody.appendChild(tr); 101 110 } … … 106 115 td.style.padding = "2px"; 107 116 td.style.margin = "0"; 117 Element.addClassName(td, 'disabledHideColorTable'); 108 118 109 119 var a = document.createElement("a"); … … 116 126 a.style.border = "1px solid #808080"; 117 127 a.style.backgroundColor = "#" + settings.colors[i]; 118 a.onclick = function() { 128 Element.addClassName(a, 'disabledHideColorTable'); 129 a.onmousedown = function() { 119 130 pne_mce_insert_tagname(id, tagname, ' code="' + this.colorCode + '"'); 120 var table = document.getElementById("mce_editor_color_table") 121 table.parentNode.removeChild(table); 131 pne_mce_hide_color_table(); 122 132 }; 123 133 … … 139 149 table.style.backgroundColor = "#fff"; 140 150 table.appendChild(tbody); 151 Element.addClassName(table, 'disabledHideColorTable'); 141 152 142 153 button_container.appendChild(table); … … 150 161 } 151 162 163 function pne_mce_hide_color_table(e) 164 { 165 if (e && Element.hasClassName(e.element(), 'disabledHideColorTable')) { 166 return; 167 } 168 169 var table = document.getElementById("mce_editor_color_table") 170 table.style.display = 'none'; 171 Event.stopObserving(document, 'mousedown', pne_mce_hide_color_table); 172 } 173
Note: See TracChangeset
for help on using the changeset viewer.