A corporation manager and dashboard for EVE Online
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

34 lines
1.0 KiB

  1. var overlaps = function(needle, haystack) {
  2. return haystack.is(needle) || haystack.has(needle).length > 0;
  3. };
  4. $(function() {
  5. // Install logout auto-POST form:
  6. $("#logout").click(function() {
  7. $("<form>", {
  8. "action": this.href,
  9. "method": "post"
  10. }).appendTo($("body")).submit();
  11. return false;
  12. });
  13. // Toggle character options on click:
  14. var charopts = $("#character-options");
  15. charopts.hide();
  16. $("#character-portrait").click(function() {
  17. if (charopts.is(":visible")) {
  18. charopts.hide();
  19. $(document).off("mouseup.charopts");
  20. } else {
  21. charopts.show();
  22. $(document).on("mouseup.charopts", function(e) {
  23. if (!overlaps(e.target, charopts) &&
  24. !overlaps(e.target, $("#character-portrait"))) {
  25. charopts.hide();
  26. $(document).off("mouseup.charopts");
  27. }
  28. });
  29. }
  30. }).css("cursor", "pointer");
  31. });