MCPcopy Create free account
hub / github.com/TheJoWo/Clean-Clode / makePreviewClickable

Function makePreviewClickable

script.js:335–360  ·  view source on GitHub ↗
(previewDiv, fullContentDiv)

Source from the content-addressed store, hash-verified

333 }
334
335 function makePreviewClickable(previewDiv, fullContentDiv) {
336 let isExpanded = false;
337
338 previewDiv.style.cursor = 'pointer';
339 previewDiv.title = 'Click to expand';
340
341 previewDiv.addEventListener('click', function() {
342 isExpanded = !isExpanded;
343
344 if (isExpanded) {
345 previewDiv.style.display = 'none';
346 fullContentDiv.style.display = 'block';
347
348 fullContentDiv.style.cursor = 'pointer';
349 fullContentDiv.title = 'Click to collapse';
350
351 const collapseHandler = function() {
352 previewDiv.style.display = 'block';
353 fullContentDiv.style.display = 'none';
354 fullContentDiv.removeEventListener('click', collapseHandler);
355 };
356
357 fullContentDiv.addEventListener('click', collapseHandler);
358 }
359 });
360 }
361
362 function updateHistoryDisplay() {
363 const history = getHistory();

Callers 1

updateHistoryDisplayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected