auto scroll after unlinking port
authorgithub138 <m.ehinger@ltur.de>
Fri, 7 Apr 2017 08:39:14 +0000 (10:39 +0200)
committergithub138 <m.ehinger@ltur.de>
Mon, 8 May 2017 13:59:59 +0000 (15:59 +0200)
LinkManagement/plugins/linkmgmt.php

index b5d1ad9..40ca300 100644 (file)
@@ -1100,6 +1100,7 @@ class lm_linkchain implements Iterator {
                                        'op'=>'unlinkPort',
                                        'port_id'=>$src_port['id'],
                                        'remote_id' => $dst_port['id'],
+                                       'hl_port_id' => $this->init,
                                        'object_id'=> $this->object_id, //$this->ports[$this->init]['object_id'],
                                        'tab' => 'linkmgmt',
                                        'linktype' => $linktype)).
@@ -4474,6 +4475,20 @@ function linkmgmt_tabhandler($object_id) {
                unset($childobj);
        }
 
+       if (isset ($_REQUEST['hl_port_id']))
+       {
+               assertUIntArg ('hl_port_id');
+               $hl_port_id = intval ($_REQUEST['hl_port_id']);
+               addJS (<<<ENDJS
+$(document).ready(function() {
+       var anchor = document.getElementById('$hl_port_id');
+       if (anchor)
+               anchor.scrollIntoView(false);
+});
+ENDJS
+       , TRUE);
+       }
+
        return;
 
 } /* tabhandler */