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");
247print "\n/* JS CODE TO ENABLE reposition management (does not work if a redirect is done after action of submission) */\n";
248print '
249 jQuery(document).ready(function() {
250 /* If page_y set, we set scrollbar with it */
251 page_y = getParameterByName("page_y", 0); /* search in GET parameter */
252 if (page_y == 0) page_y = jQuery("#page_y").text(); /* search in POST parameter that is filed at bottom of page */
253 if (page_y > 0) {
254 console.log("page_y found is "+page_y);
255 jQuery("html, body").scrollTop(page_y);
256 }
257
258 /* Set handler to add page_y param on output (click on href links or submit button) */
259 jQuery(".reposition").click(function(event) {
260 var page_y = jQuery(document).scrollTop();
261 if (page_y > 0) {
262 if (this.href) {
263 console.log("We click on tag with .reposition class. this.ref was "+this.href);
264 var url = new URL(this.href, window.location.origin);
265 url.searchParams.delete("page_y"); /* remove page_y param if already present */
266 url.searchParams.set("page_y", page_y);
267 this.href = url.toString();
268 console.log("We click on tag with .reposition class. this.ref is now "+this.href);
269 } else {
270 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);
279print "\n/* JS CODE TO ENABLE ClipBoard copy paste */\n";
280print '
281 jQuery(document).ready(function() {
282 jQuery(\'.clipboardCPShowOnHover\').hover(
283 function() {
284 console.log("We hover a value with a copy paste feature");
285 $(this).children(".clipboardCPButton, .clipboardCPText").css("display", "inline-block"); /* better than .show() because the show set the display to "inline" */
286 },
287 function() {
288 console.log("We hover out the value with a copy paste feature");
333 $(this).parent().children(".clipboardCPTick").css("display", "inline-block"); /* better than .show() because the show set the display to "inline" */