]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
After clicking save/cancel on a link, scroll to the link itself.
authorSébastien SAUVAGE <sebsauvage@sebsauvage.net>
Wed, 27 Feb 2013 17:24:07 +0000 (18:24 +0100)
committerSébastien SAUVAGE <sebsauvage@sebsauvage.net>
Wed, 27 Feb 2013 17:24:07 +0000 (18:24 +0100)
index.php
tpl/linklist.html

index 0590b2f64f46deb343c44d1c8f77ded86f49b41a..1ac5187b91d54391961b27d877f85f088ed44390 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1437,6 +1437,7 @@ function renderPage()
         // 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; }
         $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.
         exit;
     }
@@ -1447,6 +1448,7 @@ function renderPage()
         // 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; }
         $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.
         exit;
     }
index 267e13bcfcc9b8d917f93902e442421369271758..45bd478fb27d61d0fe62a1378877c211bc4a5dc8 100644 (file)
@@ -30,6 +30,7 @@
     <ul>
         {loop="links"}
         <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="linkcontainer">
                 {if="isLoggedIn()"}