diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-07-01 00:27:31 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-07-06 18:10:01 +0300 |
commit | c2255c5779b9f7247c08772a5514f28b3a7931cf (patch) | |
tree | 9e844ae7db98c407d43d9e8ce9638d8470ac1666 /app | |
parent | 007d2f7076cd1c1fafc7535168af6c8dc15cb0db (diff) |
refactor tree.js to use ES class syntax
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/tree.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/assets/javascripts/tree.js b/app/assets/javascripts/tree.js index 77ae6109bc6..1f1fc155fcd 100644 --- a/app/assets/javascripts/tree.js +++ b/app/assets/javascripts/tree.js @@ -1,7 +1,7 @@ -/* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, quotes, consistent-return, no-var, one-var, one-var-declaration-per-line, no-else-return, prefer-arrow-callback, max-len */ +/* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, quotes, consistent-return, no-var, one-var, one-var-declaration-per-line, no-else-return, prefer-arrow-callback, class-methods-use-this */ -window.TreeView = (function() { - function TreeView() { +class TreeView { + constructor() { this.initKeyNav(); // Code browser tree slider // Make the entire tree-item row clickable, but not if clicking another link (like a commit message) @@ -22,7 +22,7 @@ window.TreeView = (function() { $('span.log_loading:first').removeClass('hide'); } - TreeView.prototype.initKeyNav = function() { + initKeyNav() { var li, liSelected; li = $("tr.tree-item"); liSelected = null; @@ -60,7 +60,7 @@ window.TreeView = (function() { } } }); - }; + } +} - return TreeView; -})(); +window.TreeView = TreeView; |