summaryrefslogtreecommitdiffstats
path: root/apps/files/src/models
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-10-04 15:33:17 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-10-20 13:58:06 +0200
commite7f5516b4d04c16ed2c12dcc9c9c5f34d9f1f73b (patch)
treea4c187c3dacfa5e9bf28fb97941678a515f3e571 /apps/files/src/models
parent3d2024faf94720125855db980d8bbebb658902d1 (diff)
downloadnextcloud-server-e7f5516b4d04c16ed2c12dcc9c9c5f34d9f1f73b.tar.gz
nextcloud-server-e7f5516b4d04c16ed2c12dcc9c9c5f34d9f1f73b.zip
Init vue comments tab
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/src/models')
-rw-r--r--apps/files/src/models/Tab.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/files/src/models/Tab.js b/apps/files/src/models/Tab.js
index 2c587e5f70a..670c72e3a3a 100644
--- a/apps/files/src/models/Tab.js
+++ b/apps/files/src/models/Tab.js
@@ -29,6 +29,7 @@ export default class Tab {
#update
#destroy
#enabled
+ #scrollBottomReached
/**
* Create a new tab instance
@@ -41,11 +42,15 @@ export default class Tab {
* @param {Function} options.update function to update the tab
* @param {Function} options.destroy function to destroy the tab
* @param {Function} [options.enabled] define conditions whether this tab is active. Must returns a boolean
+ * @param {Function} [options.scrollBottomReached] executed when the tab is scrolled to the bottom
*/
- constructor({ id, name, icon, mount, update, destroy, enabled } = {}) {
+ constructor({ id, name, icon, mount, update, destroy, enabled, scrollBottomReached } = {}) {
if (enabled === undefined) {
enabled = () => true
}
+ if (scrollBottomReached === undefined) {
+ scrollBottomReached = () => {}
+ }
// Sanity checks
if (typeof id !== 'string' || id.trim() === '') {
@@ -69,6 +74,9 @@ export default class Tab {
if (typeof enabled !== 'function') {
throw new Error('The enabled argument should be a function')
}
+ if (typeof scrollBottomReached !== 'function') {
+ throw new Error('The scrollBottomReached argument should be a function')
+ }
this.#id = id
this.#name = name
@@ -77,6 +85,7 @@ export default class Tab {
this.#update = update
this.#destroy = destroy
this.#enabled = enabled
+ this.#scrollBottomReached = scrollBottomReached
}
@@ -108,4 +117,8 @@ export default class Tab {
return this.#enabled
}
+ get scrollBottomReached() {
+ return this.#scrollBottomReached
+ }
+
}