Fix reposition class

This commit is contained in:
Laurent Destailleur 2018-04-19 21:33:26 +02:00
parent 16e27a445b
commit 99feaf5275
2 changed files with 6 additions and 6 deletions

View File

@ -144,7 +144,7 @@ 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);

View File

@ -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 : '';