visible.js 1.3 KB

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