202 // Click on a link into the popup "link to" or other dropdown that ask to close drop down on element click, so close dropdown
203 $(".dropdowncloseonclick").on(\'click\', function () {
204 console.log("Link has class dropdowncloseonclick, so we close/hide the popup ul");
205 //$(this).parent().parent().hide(); // $(this).parent().parent() is ul
206 $(this).parent().parent().removeClass("open"); // $(this).parent().parent() is ul
207 });
208
209 // Click outside of any dropdown
210 $(document).bind(\'click\', function (e) {
211 var $clicked = $(e.target); // This is element we click on
212 if (!$clicked.parents().hasClass("dropdown")) {
213 //console.log("close dropdown dd ul - we click outside");
214 //$(".dropdown dd ul").hide();
215 $(".dropdown dd ul").removeClass("open");
216
217 if ($("input:hidden[name=formfilteraction]").val() == "listafterchangingselectedfields") {
218 console.log("resubmit form saved into lastopendropdown after clicking outside of dropdown and having change selectlist from selectlist field of hamburger dropdown");
243print "\n/* JS CODE TO ENABLE reposition management (does not work if a redirect is done after action of submission) */\n";
244print '
245 jQuery(document).ready(function() {
246/* If page_y set, we set scrollbar with it */
247 page_y = getParameterByName("page_y", 0); /* search in GET parameter */
248if (page_y == 0) page_y = jQuery("#page_y").text(); /* search in POST parameter that is filed at bottom of page */
249if (page_y > 0) {
250 console.log("page_y found is "+page_y);
251 jQuery("html, body").scrollTop(page_y);
252 }
253
254/* Set handler to add page_y param on output (click on href links or submit button) */
255 jQuery(".reposition").click(function(event) {
256 var page_y = jQuery(document).scrollTop();
257if (page_y > 0) {
258if (this.href) {
259 console.log("We click on tag with .reposition class. this.ref was "+this.href);
260 var url = new URL(this.href, window.location.origin);
261 url.searchParams.delete("page_y"); /* remove page_y param if already present */
262 url.searchParams.set("page_y", page_y);
263 this.href = url.toString();
264 console.log("We click on tag with .reposition class. this.ref is now "+this.href);
265 } else {
266 console.log("We click on tag with .reposition class but element is not an <a> html tag, so we try to update input form field with name=page_y with value "+page_y);
275print "\n/* JS CODE TO ENABLE ClipBoard copy paste */\n";
276print '
277 jQuery(document).ready(function() {
278 jQuery(\'.clipboardCPShowOnHover\').hover(
279 function() {
280 console.log("We hover a value with a copy paste feature");
281 $(this).children(".clipboardCPButton, .clipboardCPText").css("display", "inline-block"); /* better than .show() because the show set the display to "inline" */
282 },
283 function() {
284 console.log("We hover out the value with a copy paste feature");
329 $(this).parent().children(".clipboardCPTick").css("display", "inline-block"); /* better than .show() because the show set the display to "inline" */