From 1c1cc1d0e99f881b0dc5727bf32ff892156e56cf Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Fri, 30 Sep 2016 21:55:49 +0200 Subject: [PATCH] Use single line if's for simple return criteria --- app/ui.js | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/app/ui.js b/app/ui.js index cfcfe1c5..ee0b6dbb 100644 --- a/app/ui.js +++ b/app/ui.js @@ -591,8 +591,7 @@ var UI; }, controlbarHandleMouseUp: function(e) { - if ((e.type == "mouseup") && (e.button != 0)) - return; + if ((e.type == "mouseup") && (e.button != 0)) return; // mouseup and mousedown on the same place toggles the controlbar if (UI.controlbarGrabbed && !UI.controlbarDrag) { @@ -604,8 +603,7 @@ var UI; }, controlbarHandleMouseDown: function(e) { - if ((e.type == "mousedown") && (e.button != 0)) - return; + if ((e.type == "mousedown") && (e.button != 0)) return; var ptr = Util.getPointerEvent(e); @@ -1129,9 +1127,7 @@ var UI; // Update parameters that depend on the clip setting updateViewClip: function() { var display; - if (!UI.rfb) { - return; - } + if (!UI.rfb) return; var display = UI.rfb.get_display(); var cur_clip = display.get_viewport(); @@ -1282,13 +1278,11 @@ var UI; * ------v------*/ showVirtualKeyboard: function() { - if (!UI.isTouchDevice) - return; + if (!UI.isTouchDevice) return; var input = document.getElementById('noVNC_keyboardinput'); - if (document.activeElement == input) - return; + if (document.activeElement == input) return; UI.keyboardVisible = true; document.getElementById('noVNC_keyboard_button') @@ -1303,13 +1297,11 @@ var UI; }, hideVirtualKeyboard: function() { - if (!UI.isTouchDevice) - return; + if (!UI.isTouchDevice) return; var input = document.getElementById('noVNC_keyboardinput'); - if (document.activeElement != input) - return; + if (document.activeElement != input) return; input.blur(); },