Guest User

Untitled

a guest
Nov 20th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. (function() {
  2.  
  3. addPopularLinkToMenu();
  4.  
  5. //Add the popular link back only if the Hot menu link exist in the menu.
  6. function addPopularLinkToMenu(){
  7. var fav_link = document.getElementById("secondary-links-posts-hot");
  8.  
  9. if (fav_link == null)
  10. {
  11. return;
  12. }
  13.  
  14. var li = document.createElement("li"),
  15. a = document.createElement("a"),
  16. a_text = document.createTextNode("Popular"),
  17. parent_menu;
  18.  
  19. li.appendChild(a);
  20. a.appendChild(a_text);
  21. a.href="/explore/posts/popular";
  22.  
  23. parent_menu = fav_link.parentElement;
  24. parent_menu.insertBefore(li,fav_link.nextSibling);
  25. }
  26.  
  27. })();
Add Comment
Please, Sign In to add comment