]> git.proxmox.com Git - mirror_novnc.git/blobdiff - core/util/cursor.js
Update copyright to 2019 for modified files
[mirror_novnc.git] / core / util / cursor.js
index 7997194f4161072aed0851bb3f5cf7c357017902..63de74197156c26acf6b2782364adee3e4839879 100644 (file)
@@ -1,15 +1,15 @@
 /*
  * noVNC: HTML5 VNC client
- * Copyright 2018 Pierre Ossman for noVNC
+ * Copyright (C) 2019 The noVNC Authors
  * Licensed under MPL 2.0 or any later version (see LICENSE.txt)
  */
 
 import { supportsCursorURIs, isTouchDevice } from './browser.js';
 
-const useFallback = !supportsCursorURIs() || isTouchDevice;
+const useFallback = !supportsCursorURIs || isTouchDevice;
 
 export default class Cursor {
-    constructor(container) {
+    constructor() {
         this._target = null;
 
         this._canvas = document.createElement('canvas');
@@ -174,13 +174,15 @@ export default class Cursor {
     }
 
     _showCursor() {
-        if (this._canvas.style.visibility === 'hidden')
+        if (this._canvas.style.visibility === 'hidden') {
             this._canvas.style.visibility = '';
+        }
     }
 
     _hideCursor() {
-        if (this._canvas.style.visibility !== 'hidden')
+        if (this._canvas.style.visibility !== 'hidden') {
             this._canvas.style.visibility = 'hidden';
+        }
     }
 
     // Should we currently display the cursor?
@@ -188,24 +190,28 @@ export default class Cursor {
     // different cursor set)
     _shouldShowCursor(target) {
         // Easy case
-        if (target === this._target)
+        if (target === this._target) {
             return true;
+        }
         // Other part of the DOM?
-        if (!this._target.contains(target))
+        if (!this._target.contains(target)) {
             return false;
+        }
         // Has the child its own cursor?
         // FIXME: How can we tell that a sub element has an
         //        explicit "cursor: none;"?
-        if (window.getComputedStyle(target).cursor !== 'none')
+        if (window.getComputedStyle(target).cursor !== 'none') {
             return false;
+        }
         return true;
     }
 
     _updateVisibility(target) {
-        if (this._shouldShowCursor(target))
+        if (this._shouldShowCursor(target)) {
             this._showCursor();
-        else
+        } else {
             this._hideCursor();
+        }
     }
 
     _updatePosition() {