diff options
Diffstat (limited to 'apps/files/src')
-rw-r--r-- | apps/files/src/models/Setting.js | 34 | ||||
-rw-r--r-- | apps/files/src/models/Tab.js | 48 | ||||
-rw-r--r-- | apps/files/src/services/Settings.js | 10 | ||||
-rw-r--r-- | apps/files/src/services/Sidebar.js | 27 |
4 files changed, 60 insertions, 59 deletions
diff --git a/apps/files/src/models/Setting.js b/apps/files/src/models/Setting.js index 3b57e330ad0..128c28d8679 100644 --- a/apps/files/src/models/Setting.js +++ b/apps/files/src/models/Setting.js @@ -23,10 +23,10 @@ export default class Setting { - #close - #el - #name - #open + _close + _el + _name + _open /** * Create a new files app setting @@ -38,32 +38,34 @@ export default class Setting { * @param {Function} [component.close] callback for when setting is closed */ constructor(name, { el, open, close }) { - this.#name = name - this.#el = el - this.#open = open - this.#close = close - if (typeof this.#open !== 'function') { - this.#open = () => {} + this._name = name + this._el = el + this._open = open + this._close = close + + if (typeof this._open !== 'function') { + this._open = () => {} } - if (typeof this.#close !== 'function') { - this.#close = () => {} + + if (typeof this._close !== 'function') { + this._close = () => {} } } get name() { - return this.#name + return this._name } get el() { - return this.#el + return this._el } get open() { - return this.#open + return this._open } get close() { - return this.#close + return this._close } } diff --git a/apps/files/src/models/Tab.js b/apps/files/src/models/Tab.js index 93770ace0ac..b425fc16b2d 100644 --- a/apps/files/src/models/Tab.js +++ b/apps/files/src/models/Tab.js @@ -22,14 +22,14 @@ export default class Tab { - #id - #name - #icon - #mount - #update - #destroy - #enabled - #scrollBottomReached + _id + _name + _icon + _mount + _update + _destroy + _enabled + _scrollBottomReached /** * Create a new tab instance @@ -78,47 +78,47 @@ export default class Tab { throw new Error('The scrollBottomReached argument should be a function') } - this.#id = id - this.#name = name - this.#icon = icon - this.#mount = mount - this.#update = update - this.#destroy = destroy - this.#enabled = enabled - this.#scrollBottomReached = scrollBottomReached + this._id = id + this._name = name + this._icon = icon + this._mount = mount + this._update = update + this._destroy = destroy + this._enabled = enabled + this._scrollBottomReached = scrollBottomReached } get id() { - return this.#id + return this._id } get name() { - return this.#name + return this._name } get icon() { - return this.#icon + return this._icon } get mount() { - return this.#mount + return this._mount } get update() { - return this.#update + return this._update } get destroy() { - return this.#destroy + return this._destroy } get enabled() { - return this.#enabled + return this._enabled } get scrollBottomReached() { - return this.#scrollBottomReached + return this._scrollBottomReached } } diff --git a/apps/files/src/services/Settings.js b/apps/files/src/services/Settings.js index 99ead3cd274..d07033891a5 100644 --- a/apps/files/src/services/Settings.js +++ b/apps/files/src/services/Settings.js @@ -22,10 +22,10 @@ export default class Settings { - #settings + _settings constructor() { - this.#settings = [] + this._settings = [] console.debug('OCA.Files.Settings initialized') } @@ -37,11 +37,11 @@ export default class Settings { * @returns {boolean} whether registering was successful */ register(view) { - if (this.#settings.filter(e => e.name === view.name).length > 0) { + if (this._settings.filter(e => e.name === view.name).length > 0) { console.error('A setting with the same name is already registered') return false } - this.#settings.push(view) + this._settings.push(view) return true } @@ -50,7 +50,7 @@ export default class Settings { * @returns {OCA.Files.Settings.Setting[]} All currently registered settings */ get settings() { - return this.#settings + return this._settings } } diff --git a/apps/files/src/services/Sidebar.js b/apps/files/src/services/Sidebar.js index 1370d83fe61..c7b6ada2aea 100644 --- a/apps/files/src/services/Sidebar.js +++ b/apps/files/src/services/Sidebar.js @@ -22,18 +22,17 @@ export default class Sidebar { - #state; - #view; + _state; constructor() { // init empty state - this.#state = {} + this._state = {} // init default values - this.#state.tabs = [] - this.#state.views = [] - this.#state.file = '' - this.#state.activeTab = '' + this._state.tabs = [] + this._state.views = [] + this._state.file = '' + this._state.activeTab = '' console.debug('OCA.Files.Sidebar initialized') } @@ -45,7 +44,7 @@ export default class Sidebar { * @returns {Object} the data state */ get state() { - return this.#state + return this._state } /** @@ -56,9 +55,9 @@ export default class Sidebar { * @returns {Boolean} */ registerTab(tab) { - const hasDuplicate = this.#state.tabs.findIndex(check => check.id === tab.id) > -1 + const hasDuplicate = this._state.tabs.findIndex(check => check.id === tab.id) > -1 if (!hasDuplicate) { - this.#state.tabs.push(tab) + this._state.tabs.push(tab) return true } console.error(`An tab with the same id ${tab.id} already exists`, tab) @@ -66,9 +65,9 @@ export default class Sidebar { } registerSecondaryView(view) { - const hasDuplicate = this.#state.views.findIndex(check => check.id === view.id) > -1 + const hasDuplicate = this._state.views.findIndex(check => check.id === view.id) > -1 if (!hasDuplicate) { - this.#state.views.push(view) + this._state.views.push(view) return true } console.error('A similar view already exists', view) @@ -82,7 +81,7 @@ export default class Sidebar { * @returns {String} the current opened file */ get file() { - return this.#state.file + return this._state.file } /** @@ -92,7 +91,7 @@ export default class Sidebar { * @param {string} id the tab unique id */ setActiveTab(id) { - this.#state.activeTab = id + this._state.activeTab = id } } |