summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-11-28 15:43:51 +0100
committerGitHub <noreply@github.com>2017-11-28 15:43:51 +0100
commit599f2fd264bfc7b1b6826fe206442806e317340f (patch)
tree50cf84d7d07d11bd65b45c2c17f37632f6cd8eff /public/js
parenta5fc5bd0979e8de1fce8a8addd351a6e7bd6aeb8 (diff)
parenteda7f7788ea8012bd8be46405c56a666c11f3fa5 (diff)
Merge pull request #365 from engelsystem/feature-igel-rewrite
Feature igel rewrite
Diffstat (limited to 'public/js')
-rw-r--r--public/js/forms.js32
-rw-r--r--public/js/moment-countdown.js28
-rw-r--r--public/js/sticky-headers.js37
3 files changed, 48 insertions, 49 deletions
diff --git a/public/js/forms.js b/public/js/forms.js
index f4e2e042..c4eb68df 100644
--- a/public/js/forms.js
+++ b/public/js/forms.js
@@ -1,28 +1,28 @@
/**
* Runs through the DOM under the element with the given id, finds all
* checkboxes and sets them to the wanted state.
- *
+ *
* @param String
* id Id of the element containing all the checkboxes
* @param Boolean
* checked True if the checkboxes should be checked
*/
function checkAll(id, checked) {
- var obj = document.getElementById(id);
- var boxes = obj.getElementsByTagName("input");
- for (var i = 0; i < boxes.length; i++) {
- if (boxes[i].type === "checkbox" && !boxes[i].disabled) {
- boxes[i].checked = checked;
- }
- }
+ var obj = document.getElementById(id);
+ var boxes = obj.getElementsByTagName("input");
+ for (var i = 0; i < boxes.length; i++) {
+ if (boxes[i].type === "checkbox" && !boxes[i].disabled) {
+ boxes[i].checked = checked;
+ }
+ }
}
-$(function() {
- /**
- * Disable every submit button after clicking (to prevent double-clicking)
- */
- $("form").submit(function(ev) {
- $("input[type='submit']").prop("readonly", true).addClass("disabled");
- return true;
- });
+$(function () {
+ /**
+ * Disable every submit button after clicking (to prevent double-clicking)
+ */
+ $("form").submit(function (ev) {
+ $("input[type='submit']").prop("readonly", true).addClass("disabled");
+ return true;
+ });
});
diff --git a/public/js/moment-countdown.js b/public/js/moment-countdown.js
index 9d655038..0cc78210 100644
--- a/public/js/moment-countdown.js
+++ b/public/js/moment-countdown.js
@@ -3,17 +3,17 @@
* class "moment-countdown" and the attribute "data-timestamp" which defines the
* countdown's time goal.
*/
-$(document).ready(function() {
- if (typeof moment !== "undefined") {
- $.each($(".moment-countdown"), function(i, e) {
- var span = $(e);
- var text = span.html();
- /* global moment */
- var timestamp = moment(parseInt(span.attr("data-timestamp") * 1000));
- span.html(text.replace("%c", timestamp.fromNow()));
- setInterval(function() {
- span.html(text.replace("%c", timestamp.fromNow()));
- }, 1000);
- });
- }
-}); \ No newline at end of file
+$(document).ready(function () {
+ if (typeof moment !== "undefined") {
+ $.each($(".moment-countdown"), function (i, e) {
+ var span = $(e);
+ var text = span.html();
+ /* global moment */
+ var timestamp = moment(parseInt(span.attr("data-timestamp") * 1000));
+ span.html(text.replace("%c", timestamp.fromNow()));
+ setInterval(function () {
+ span.html(text.replace("%c", timestamp.fromNow()));
+ }, 1000);
+ });
+ }
+});
diff --git a/public/js/sticky-headers.js b/public/js/sticky-headers.js
index 1d6e9402..6e6a75e2 100644
--- a/public/js/sticky-headers.js
+++ b/public/js/sticky-headers.js
@@ -1,32 +1,31 @@
/**
* Enables the fixed headers and time lane for the shift-calendar and datatables
*/
-$(document).ready(
- function() {
- if ($(".shift-calendar").length) {
+$(document).ready(function () {
+ if ($(".shift-calendar").length) {
var timeLanes = $(".shift-calendar .time");
var headers = $(".shift-calendar .header");
var topReference = $(".container-fluid .row");
- var top = headers.offset().top;
- var left = 15;
timeLanes.css({
- "position" : "relative",
- "z-index" : 999
+ "position": "relative",
+ "z-index": 999
});
headers.css({
- "position" : "relative",
- "z-index" : 900
+ "position": "relative",
+ "z-index": 900
});
$(window).scroll(
- function() {
- timeLanes.css({
- "left" : Math.max(0, $(window).scrollLeft() - left) + "px"
- });
- headers.css({
- "top" : Math.max(0, $(window).scrollTop() - top
- + topReference.offset().top)
+ function () {
+ var top = headers.parent().offset().top;
+ var left = 15;
+ timeLanes.css({
+ "left": Math.max(0, $(window).scrollLeft() - left) + "px"
+ });
+ headers.css({
+ "top": Math.max(0, $(window).scrollTop() - top
+ + topReference.offset().top)
+ "px"
- });
+ });
});
- }
- }); \ No newline at end of file
+ }
+});