lychee/src/scripts/visible.js

62 lines
1.3 KiB
JavaScript
Raw Normal View History

/**
* @description This module is used to check if elements are visible or not.
2015-02-01 21:08:37 +00:00
* @copyright 2015 by Tobias Reich
*/
2014-10-18 16:13:45 +00:00
visible = {}
2014-10-18 16:02:06 +00:00
visible.albums = function() {
if ($('#tools_albums').css('display')==='block') return true;
2014-11-20 22:27:41 +00:00
return false;
2014-10-18 16:08:35 +00:00
}
2014-10-18 16:02:06 +00:00
visible.album = function() {
if ($('#tools_album').css('display')==='block') return true;
2014-11-20 22:27:41 +00:00
return false;
2014-10-18 16:08:35 +00:00
}
2014-10-18 16:02:06 +00:00
visible.photo = function() {
if ($('#imageview.fadeIn').length>0) return true;
2014-11-20 22:27:41 +00:00
return false;
2014-10-18 16:08:35 +00:00
}
2014-02-17 15:22:53 +00:00
2014-10-18 16:02:06 +00:00
visible.search = function() {
if (search.hash!==null) return true;
2014-11-20 22:27:41 +00:00
return false;
2014-10-18 16:08:35 +00:00
}
2014-10-18 16:02:06 +00:00
visible.infobox = function() {
if ($('#infobox.active').length>0) return true;
2014-11-20 22:27:41 +00:00
return false;
2014-10-18 16:08:35 +00:00
}
2014-10-18 16:02:06 +00:00
visible.infoboxbutton = function() {
if (visible.albums()) return false;
if (visible.photo()) return true;
if (visible.album()&&$('#button_info_album:visible').length>0) return true;
2014-11-20 22:27:41 +00:00
return false;
2014-10-18 16:08:35 +00:00
}
visible.header = function() {
if (header.dom().hasClass('hidden')===true) return false;
2014-11-20 22:27:41 +00:00
return true;
2014-10-18 16:08:35 +00:00
}
2014-10-18 16:02:06 +00:00
visible.message = function() {
if ($('.message').length>0) return true;
2014-11-20 22:27:41 +00:00
return false;
2014-10-18 16:08:35 +00:00
}
2014-10-18 16:02:06 +00:00
visible.signin = function() {
if ($('.message .sign_in').length>0) return true;
2014-11-20 22:27:41 +00:00
return false;
2014-10-18 16:08:35 +00:00
}
2014-10-18 16:02:06 +00:00
visible.contextMenu = function() {
return basicContext.visible();
2014-10-18 16:08:35 +00:00
}
2014-02-17 15:22:53 +00:00
2014-10-18 16:02:06 +00:00
visible.multiselect = function() {
if ($('#multiselect').length>0) return true;
2014-11-20 22:27:41 +00:00
return false;
2014-10-18 16:02:06 +00:00
}