« get me outta code hell

ListScrollForm.scrollToBeginning function - tui-lib - Pure Node.js library for making visual command-line programs (ala vim, ncdu)
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-06-04 09:58:58 -0300
committerFlorrie <towerofnix@gmail.com>2018-06-04 09:58:58 -0300
commita3df7cf7205d12ab5e6fc7b5746cae6c4a6a8214 (patch)
tree30431943ea11903e40d1bfb517d3da2e625714ed
parent6e0fa96243902c4354764c2edc79edf1190280fc (diff)
ListScrollForm.scrollToBeginning function
-rw-r--r--ui/form/ListScrollForm.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/form/ListScrollForm.js b/ui/form/ListScrollForm.js
index fe7ef0e..00a6da1 100644
--- a/ui/form/ListScrollForm.js
+++ b/ui/form/ListScrollForm.js
@@ -150,6 +150,11 @@ module.exports = class ListScrollForm extends Form {
     this.scrollItems = i
   }
 
+  scrollToBeginning() {
+    this.scrollItems = 0
+    this.fixLayout()
+  }
+
   scrollToEnd() {
     this.scrollElementIntoEndOfView(this.inputs[this.inputs.length - 1])
     this.fixLayout()