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

View File

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

View File

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