assets/themes/j1/core/js/template.js in j1-template-2022.0.0 vs assets/themes/j1/core/js/template.js in j1-template-2022.0.1

- old
+ new

@@ -2454,11 +2454,15 @@ // ------------------------------------------------------------------------- eventHandler: function eventHandler(options) { var defaultOptions = options; var logger = log4javascript.getLogger('j1.core.navigator.eventHandler'); var $getNav = $('nav.navbar.navigator'); - var json_data; // const seeMe = 'https://smee.io/wlNIFNiJN0GClm2'; + var json_data; // jadams: unused code (for now).: manages HTML5 server side events + // for incoming messages from Git Server send e.g. on a 'pull request' + // NOTE: used for ControlCenter (cc) functionality only !!! + // ----------------------------------------------------------------------- + // const seeMe = 'https://smee.io/wlNIFNiJN0GClm2'; // const middleware = 'localhost:5000/state'; // const web_server_dev = 'http://localhost:41000/status'; // const utility_server = 'http://localhost:41001/git?request=pull'; // var sender = seeMe; // var payload; @@ -2486,17 +2490,22 @@ // j1.sendMessage( 'j1.core.navigator', 'j1.adapter.navigator', message ); // // return true; // }; // END event onMessage // } - // bind click event to all links with "#" to suppress default action - // See: https://stackoverflow.com/questions/134845/which-href-value-should-i-use-for-javascript-links-or-javascriptvoid0 + // bind click event to all plain '#' links to prevent default action + // 'scroll-to-top' + // See: + // https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault + // https://stackoverflow.com/questions/134845/which-href-value-should-i-use-for-javascript-links-or-javascriptvoid0 // $('a[href="#"]').click(function (e) { + logger.debug('\n' + 'click event on href "#" detected: prevent default action'); e.preventDefault ? e.preventDefault() : e.returnValue = false; - logger.info('\n' + 'bound click event to "#", suppress default action'); - }); // $('a:contains("?#")').click(function(e) { + }); // jadams: test code for jQuery plugin 'regex' + // ----------------------------------------------------------------------- + // $('a:contains("?#")').click(function(e) { // e.preventDefault ? e.preventDefault() : e.returnValue = false; // logger.info('bound click event to "?#*", suppress default action'); // }); // ----------------------------------------------------------------------- // Navbar Sticky \ No newline at end of file