From 8d6a694711fd0aabb8776b9e40fdd05a09c4712e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 11 Jun 2018 11:31:28 +0300 Subject: [PATCH] Performance tweaks, avoid slow repaints when showing tooltips --- static/css/base.css | 2 ++ static/js/checks.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/static/css/base.css b/static/css/base.css index e19b5cc9..c2725cf8 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -59,6 +59,8 @@ body { .status { font-size: 24px; + display: inline-block; + width: 24px; } .status.icon-up { color: #5cb85c; } diff --git a/static/js/checks.js b/static/js/checks.js index a2e6b5eb..39612c58 100644 --- a/static/js/checks.js +++ b/static/js/checks.js @@ -175,7 +175,7 @@ $(function () { return false; }); - $(".integrations img").click(function() { + $(".integrations").on("click", "img", function() { var isOff = $(this).toggleClass("off").hasClass("off"); var token = $('input[name=csrfmiddlewaretoken]').val(); $.ajax({ @@ -254,6 +254,7 @@ $(function () { $('[data-toggle="tooltip"]').tooltip({ html: true, + container: "body", title: function() { var cssClasses = this.getAttribute("class"); if (cssClasses.indexOf("icon-new") > -1) @@ -315,7 +316,6 @@ $(function () { if (document.title != data.title) { document.title = data.title; } - } }); }