Difference between revisions of "Widget:Compass"

From LINKS Community Center
Jump to: navigation, search
Line 608: Line 608:
  
 
         const handler = event => {
 
         const handler = event => {
             // console.log('target', event.target)
+
             const answerId = event.currentTarget.id;
            // console.log('c-target', event.currentTarget)
+
             const actions = actions[answerId];
             // if (!event.target.classList.contains('choice')) return;
 
  
             const id = event.currentTarget.id;
+
             if (!actions) return;
             console.log('element id=' + id);
+
 
            console.log('actions', actions[id]?.filter)
+
             if (answerId.indexOf('tech') !== -1) {
 +
                // Action takes us to Tech Library
 +
 
 +
                const str = JSON.stringify(actions);
 +
                const enc = btoa(encodeURIComponent(str))
 +
 
 +
                console.log(enc)
 +
            }
 
         }
 
         }
  
         document.querySelectorAll('.choice').forEach(el => void el.addEventListener('click', handler, { passive: true }));
+
         document.querySelectorAll('.choice').forEach(el => el.addEventListener('click', handler, { passive: true }));
 
          
 
          
 
     </script>
 
     </script>
 
</includeonly>
 
</includeonly>

Revision as of 14:06, 24 November 2022

Development version of the Compass.
Not ready for production!