After clicking save/cancel on a link, scroll to the link itself.

This commit is contained in:
Sébastien SAUVAGE 2013-02-27 18:24:07 +01:00
parent b2877611c3
commit b342b2a4c7
2 changed files with 3 additions and 0 deletions

View File

@ -1437,6 +1437,7 @@ function renderPage()
// If we are called from the bookmarklet, we must close the popup: // If we are called from the bookmarklet, we must close the popup:
if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; } if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; }
$returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' );
$returnurl .= '#'.smallHash($linkdate); // Scroll to the link which has been edited.
header('Location: '.$returnurl); // After saving the link, redirect to the page the user was on. header('Location: '.$returnurl); // After saving the link, redirect to the page the user was on.
exit; exit;
} }
@ -1447,6 +1448,7 @@ function renderPage()
// If we are called from the bookmarklet, we must close the popup; // If we are called from the bookmarklet, we must close the popup;
if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; } if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; }
$returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' );
$returnurl .= '#'.smallHash($_POST['lf_linkdate']); // Scroll to the link which has been edited.
header('Location: '.$returnurl); // After canceling, redirect to the page the user was on. header('Location: '.$returnurl); // After canceling, redirect to the page the user was on.
exit; exit;
} }

View File

@ -30,6 +30,7 @@
<ul> <ul>
{loop="links"} {loop="links"}
<li{if="$value.class"} class="{$value.class}"{/if}> <li{if="$value.class"} class="{$value.class}"{/if}>
<a name="{$value.linkdate|smallHash}" id="{$value.linkdate|smallHash}"></a>
<div class="thumbnail">{$value.url|thumbnail}</div> <div class="thumbnail">{$value.url|thumbnail}</div>
<div class="linkcontainer"> <div class="linkcontainer">
{if="isLoggedIn()"} {if="isLoggedIn()"}