visible.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * @name Visible Module
  3. * @description This module is used to check if elements are visible or not.
  4. * @author Tobias Reich
  5. * @copyright 2014 by Tobias Reich
  6. */
  7. visible = {}
  8. visible.albums = function() {
  9. if ($('#tools_albums').css('display')==='block') return true;
  10. return false;
  11. }
  12. visible.album = function() {
  13. if ($('#tools_album').css('display')==='block') return true;
  14. return false;
  15. }
  16. visible.photo = function() {
  17. if ($('#imageview.fadeIn').length>0) return true;
  18. return false;
  19. }
  20. visible.search = function() {
  21. if (search.code!==null&&search.code!=='') return true;
  22. return false;
  23. }
  24. visible.infobox = function() {
  25. if ($('#infobox.active').length>0) return true;
  26. return false;
  27. }
  28. visible.infoboxbutton = function() {
  29. if (visible.albums()) return false;
  30. if (visible.photo()) return true;
  31. if (visible.album()&&$('#button_info_album:visible').length>0) return true;
  32. return false;
  33. }
  34. visible.controls = function() {
  35. if (lychee.loadingBar.css('opacity')<1) return false;
  36. return true;
  37. }
  38. visible.message = function() {
  39. if ($('.message').length>0) return true;
  40. return false;
  41. }
  42. visible.signin = function() {
  43. if ($('.message .sign_in').length>0) return true;
  44. return false;
  45. }
  46. visible.contextMenu = function() {
  47. return basicContext.visible();
  48. }
  49. visible.multiselect = function() {
  50. if ($('#multiselect').length>0) return true;
  51. return false;
  52. }