From 267b10379429e19e856039ccc9b1842a632e9ab0 Mon Sep 17 00:00:00 2001 From: Ollie Terrance Date: Wed, 21 May 2014 22:42:24 +0100 Subject: [PATCH] Keyboard shortcuts modal --- Homely/res/css/homely.css | 6 ++++ Homely/res/html/homely.html | 58 ++++++++++++++++++++++++++++++++++++- Homely/res/js/homely.js | 9 ++---- 3 files changed, 66 insertions(+), 7 deletions(-) diff --git a/Homely/res/css/homely.css b/Homely/res/css/homely.css index ce29bac..7d951a6 100644 --- a/Homely/res/css/homely.css +++ b/Homely/res/css/homely.css @@ -219,3 +219,9 @@ input[type=range] { #settings .form-group:last-of-type { margin-bottom: 0; } +#shortcuts .modal-body { + padding: 0 20px 10px; +} +#shortcuts .alert { + margin-top: 25px; +} diff --git a/Homely/res/html/homely.html b/Homely/res/html/homely.html index 219df37..4d216a5 100644 --- a/Homely/res/html/homely.html +++ b/Homely/res/html/homely.html @@ -294,7 +294,7 @@ Enable advanced keyboard navigation -

See the readme for controls.

+

Press ? or see the readme for controls.

@@ -493,6 +493,62 @@

+ diff --git a/Homely/res/js/homely.js b/Homely/res/js/homely.js index c7ebf73..3642c99 100644 --- a/Homely/res/js/homely.js +++ b/Homely/res/js/homely.js @@ -2229,6 +2229,8 @@ $(document).ready(function() { }).bind(["s", "y"], function(e, key) { closeDropdowns(); $("#menu-settings a").click(); + }).bind("?", function(e, key) { + $("#shortcuts").modal(); }); } // if settings modal is open @@ -2306,12 +2308,7 @@ $(document).ready(function() { } }); weatherCallbacks.push(function() { - var label = $("#menu-weather .menu-label"); - if (settings.style["topbar"].labels) { - label.show(); - } else { - label.parent().attr("title", label.text()); - } + if (settings.style["topbar"].labels) $("#menu-weather .menu-label").show(); }); proxyCallbacks.push(function() { var label = $("#menu-proxy .menu-label");