124 // Click on a link into the popup "link to" or other dropdown that ask to close drop down on element click, so close dropdown
125 $(".dropdowncloseonclick").on(\'click\', function () {
126 console.log("Link has class dropdowncloseonclick, so we close/hide the popup ul");
127 //$(this).parent().parent().hide(); // $(this).parent().parent() is ul
128 $(this).parent().parent().removeClass("open"); // $(this).parent().parent() is ul
129 });
130
131 // Click outside of any dropdown
132 $(document).bind(\'click\', function (e) {
133 var $clicked = $(e.target); // This is element we click on
134 if (!$clicked.parents().hasClass("dropdown")) {
135 //console.log("close dropdown dd ul - we click outside");
136 //$(".dropdown dd ul").hide();
137 $(".dropdown dd ul").removeClass("open");
138
139 if ($("input:hidden[name=formfilteraction]").val() == "listafterchangingselectedfields") {
140 console.log("resubmit form saved into lastopendropdown after clicking outside of dropdown and having change selectlist from selectlist field of hamburger dropdown");
167print "\n/* JS CODE TO ENABLE reposition management (does not work if a redirect is done after action of submission) */\n";
168print '
169 jQuery(document).ready(function() {
170/* If page_y set, we set scollbar with it */
171 page_y=getParameterByName(\'page_y\', 0); /* search in GET parameter */
172 if (page_y == 0) page_y = jQuery("#page_y").text(); /* search in POST parameter that is filed at bottom of page */
173 if (page_y > 0)
174 {
175 console.log("page_y found is "+page_y);
176 $(\'html, body\').scrollTop(page_y);
177 }
178
179 /* Set handler to add page_y param on output (click on href links or submit button) */
180 jQuery(".reposition").click(function() {
181 var page_y = $(document).scrollTop();
182
183 if (page_y > 0)
184 {
185 if (this.href)
186 {
187 var hrefarray = this.href.split("#", 2);
188 this.href=hrefarray[0]+\'&page_y=\'+page_y;
189 console.log("We click on tag with .reposition class. this.ref is now "+this.href);
190 }
191 else
192 {
193 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);