Fix reposition class
This commit is contained in:
parent
16e27a445b
commit
99feaf5275
@ -143,17 +143,17 @@ print '
|
|||||||
|
|
||||||
/* Set handler to add page_y param on output (click on href links or submit button) */
|
/* Set handler to add page_y param on output (click on href links or submit button) */
|
||||||
jQuery(".reposition").click(function() {
|
jQuery(".reposition").click(function() {
|
||||||
var page_y = $(document).scrollTop();
|
var page_y = $(document).scrollTop();
|
||||||
if (this.ref)
|
if (this.href)
|
||||||
{
|
{
|
||||||
this.href=this.href+\'&page_y=\'+page_y;
|
this.href=this.href+\'&page_y=\'+page_y;
|
||||||
console.log("We click on tag with .reposition class. this.ref is now "+this.href);
|
console.log("We click on tag with .reposition class. this.ref is now "+this.href);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
console.log("We click on tag with .reposition class but element is not an <a> html tag, so we try to update form field page_y with value "+page_y);
|
console.log("We click on tag with .reposition class but element is not an <a> html tag, so we try to update form field page_y with value "+page_y);
|
||||||
jQuery("input[type=hidden][name=page_y]").val(page_y);
|
jQuery("input[type=hidden][name=page_y]").val(page_y);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});'."\n";
|
});'."\n";
|
||||||
|
|
||||||
|
|||||||
@ -113,7 +113,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
|||||||
{
|
{
|
||||||
$fieldid='id';
|
$fieldid='id';
|
||||||
if ($object->table_element == 'societe') $fieldid='socid';
|
if ($object->table_element == 'societe') $fieldid='socid';
|
||||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?'.$fieldid.'=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
|
print '<td align="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?'.$fieldid.'=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
$html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : '';
|
$html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : '';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user