visible.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 (header.dom('.header__toolbar--public').hasClass('header__toolbar--visible')) return true
  8. if (header.dom('.header__toolbar--albums').hasClass('header__toolbar--visible')) return true
  9. return false
  10. }
  11. visible.album = function() {
  12. if (header.dom('.header__toolbar--album').hasClass('header__toolbar--visible')) return true
  13. return false
  14. }
  15. visible.photo = function() {
  16. if ($('#imageview.fadeIn').length>0) return true
  17. return false
  18. }
  19. visible.search = function() {
  20. if (search.hash!=null) return true
  21. return false
  22. }
  23. visible.sidebar = function() {
  24. if (sidebar.dom().hasClass('active')===true) return true
  25. return false
  26. }
  27. visible.sidebarbutton = function() {
  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('header--hidden')===true) return false
  34. return true
  35. }
  36. visible.contextMenu = function() {
  37. return basicContext.visible()
  38. }
  39. visible.multiselect = function() {
  40. if ($('#multiselect').length>0) return true
  41. return false
  42. }