172 // Click on a link into the popup "link to" or other dropdown that ask to close drop down on element click, so close dropdown
173 $(".dropdowncloseonclick").on(\'click\', function () {
174 console.log("Link has class dropdowncloseonclick, so we close/hide the popup ul");
175 //$(this).parent().parent().hide(); // $(this).parent().parent() is ul
176 $(this).parent().parent().removeClass("open"); // $(this).parent().parent() is ul
177 });
178
179 // Click outside of any dropdown
180 $(document).bind(\'click\', function (e) {
181 var $clicked = $(e.target); // This is element we click on
182 if (!$clicked.parents().hasClass("dropdown")) {
183 //console.log("close dropdown dd ul - we click outside");
184 //$(".dropdown dd ul").hide();
185 $(".dropdown dd ul").removeClass("open");
186
187 if ($("input:hidden[name=formfilteraction]").val() == "listafterchangingselectedfields") {
188 console.log("resubmit form saved into lastopendropdown after clicking outside of dropdown and having change selectlist from selectlist field of hamburger dropdown");
217print "\n/* JS CODE TO ENABLE reposition management (does not work if a redirect is done after action of submission) */\n";
218print '
219 jQuery(document).ready(function() {
220 /* If page_y set, we set scrollbar with it */
221 page_y = getParameterByName("page_y", 0); /* search in GET parameter */
222 if (page_y == 0) page_y = jQuery("#page_y").text(); /* search in POST parameter that is filed at bottom of page */
223 if (page_y > 0) {
224 console.log("page_y found is "+page_y);
225 jQuery("html, body").scrollTop(page_y);
226 }
227
228 /* Set handler to add page_y param on output (click on href links or submit button) */
229 jQuery(".reposition").click(function(event) {
230 var page_y = jQuery(document).scrollTop();
231 if (page_y > 0) {
232 if (this.href) {
233 console.log("We click on tag with .reposition class. this.ref was "+this.href);
234 var url = new URL(this.href, window.location.origin);
235 url.searchParams.delete("page_y"); /* remove page_y param if already present */
236 url.searchParams.set("page_y", page_y);
237 this.href = url.toString();
238 console.log("We click on tag with .reposition class. this.ref is now "+this.href);
239 } else {
240 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);
249print "\n/* JS CODE TO ENABLE ClipBoard copy paste */\n";
250print '
251 jQuery(document).ready(function() {
252 jQuery(\'.clipboardCPShowOnHover\').hover(
253 function() {
254 console.log("We hover a value with a copy paste feature");
255 $(this).children(".clipboardCPButton, .clipboardCPText").css("display", "inline-block"); /* better than .show() because the show set the display to "inline" */
256 },
257 function() {
258 console.log("We hover out the value with a copy paste feature");
303 $(this).parent().children(".clipboardCPTick").css("display", "inline-block"); /* better than .show() because the show set the display to "inline" */