@@ -528,6 +528,7 @@ BUT SOON WILL HAVE BOTH 86-DOS AND CP/M-86. JOE
528528 Milestone Modal Pop-up
529529 When a milestone title or date is clicked, this modal pops up with a copy of the milestone content.
530530 This allows for easier readability due to the use of the "lead" class for the font.
531+ This modal is handled by assets/js/index.js
531532*/ }}
532533<div class= " modal fade" id= " milestoneModal" tabindex= " -1" aria-labelledby= " milestoneModalLabel" aria-hidden= " true" >
533534 <div class= " modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable" >
@@ -545,68 +546,6 @@ BUT SOON WILL HAVE BOTH 86-DOS AND CP/M-86. JOE
545546 </div>
546547 </div>
547548</div>
548- <script>
549- // Minimal content population using Bootstrap's built-in events
550- document.addEventListener ('DOMContentLoaded', function() {
551- var milestoneModal = document.getElementById ('milestoneModal');
552- if (milestoneModal) {
553- milestoneModal.addEventListener ('show.bs.modal ', function(event) {
554- var triggerElement = event.relatedTarget ;
555-
556- // Check if this is a milestone link with data-milestone-id attribute
557- var milestoneId = triggerElement.getAttribute ('data-milestone-id');
558-
559- if (milestoneId) {
560- // This is a milestone link - find the anchor with matching ID
561- var anchor = document.getElementById (milestoneId);
562- if (anchor) {
563- var col = anchor.closest ('.col ');
564- if (col) {
565- var colClone = col.cloneNode (true);
566- // title - use button text
567- var buttonText = triggerElement.textContent.trim ();
568- document.getElementById ('milestoneModalLabel').textContent = buttonText || 'Milestone Details';
569- // content
570- var modalBody = document.getElementById ('milestoneModalBody');
571- modalBody.innerHTML = '';
572- modalBody.appendChild (colClone);
573- // cleanup duplicate header
574- var headerInClone = colClone.querySelector ('.card -header');
575- if (headerInClone) {
576- headerInClone.remove ();
577- }
578- return; // Found and processed the milestone
579- }
580- }
581- } else {
582- // This is a direct milestone button click - use original logic
583- var col = triggerElement.closest ('.col ');
584- if (col) {
585- var colClone = col.cloneNode (true);
586- // title - use button text
587- var buttonText = triggerElement.textContent.trim ();
588- document.getElementById ('milestoneModalLabel').textContent = buttonText || 'Milestone Details';
589- // content
590- var modalBody = document.getElementById ('milestoneModalBody');
591- modalBody.innerHTML = '';
592- modalBody.appendChild (colClone);
593- // cleanup duplicate header
594- var headerInClone = colClone.querySelector ('.card -header');
595- if (headerInClone) {
596- headerInClone.remove ();
597- }
598- }
599- }
600- });
601- // clear content when modal closes
602- milestoneModal.addEventListener ('hidden.bs.modal ', function() {
603- document.getElementById ('milestoneModalLabel').textContent = '';
604- document.getElementById ('milestoneModalBody').innerHTML = '';
605- });
606- }
607- });
608- </script>
609-
610549{{- end }}
611550</div>
612551{{- end }}
0 commit comments