Cleanup and conform to coding guidelines

This commit is contained in:
Matthias Jentsch 2015-08-25 16:58:14 +02:00
parent 96e3845f46
commit a7a93803ee
3 changed files with 12 additions and 16 deletions

View File

@ -4,7 +4,6 @@
* Icinga.History
*
* This is where we care about the browser History API
*
*/
(function (Icinga, $) {
@ -89,7 +88,6 @@
}
});
// TODO: update navigation
// Did we find any URL? Then push it!
if (url !== '') {
this.push(url);

View File

@ -480,8 +480,7 @@
* @param value {String} The value to set, can be '1', '0' and 'unchanged'
* @param $checkbox {jQuery} The checkbox
*/
setTriState: function(value, $checkbox)
{
setTriState: function(value, $checkbox) {
switch (value) {
case ('1'):
$checkbox.prop('checked', true).prop('indeterminate', false);

View File

@ -76,20 +76,19 @@
* @param {selector} element The element to check
* @returns {Boolean}
*/
isVisible: function(element)
{
var $element = $(element);
if (!$element.length) {
return false;
}
isVisible: function(element) {
var $element = $(element);
if (!$element.length) {
return false;
}
var docViewTop = $(window).scrollTop();
var docViewBottom = docViewTop + $(window).height();
var elemTop = $element.offset().top;
var elemBottom = elemTop + $element.height();
var docViewTop = $(window).scrollTop();
var docViewBottom = docViewTop + $(window).height();
var elemTop = $element.offset().top;
var elemBottom = elemTop + $element.height();
return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom) &&
(elemBottom <= docViewBottom) && (elemTop >= docViewTop));
return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom) &&
(elemBottom <= docViewBottom) && (elemTop >= docViewTop));
},
getUrlHelper: function () {