1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 12:34:12 +01:00

Initial work towards making <C-o> and <C-i> more Vim-like.

This commit is contained in:
Kris Maglione
2011-08-07 18:56:38 -04:00
parent 84a69b920a
commit 3aa12ba117
7 changed files with 135 additions and 62 deletions

View File

@@ -127,12 +127,7 @@ var Tabs = Module("tabs", {
/**
* @property {Object} The local options store for the current tab.
*/
get options() {
let store = this.localStore;
if (!("options" in store))
store.options = {};
return store.options;
},
get options() this.localStore.options,
get visibleTabs() config.tabbrowser.visibleTabs || this.allTabs.filter(function (tab) !tab.hidden),
@@ -151,8 +146,8 @@ var Tabs = Module("tabs", {
getLocalStore: function getLocalStore(tabIndex) {
let tab = this.getTab(tabIndex);
if (!tab.dactylStore)
tab.dactylStore = {};
return tab.dactylStore;
tab.dactylStore = Object.create(this.localStorePrototype);
return tab.dactylStore.instance = tab.dactylStore;
},
/**
@@ -161,6 +156,11 @@ var Tabs = Module("tabs", {
*/
get localStore() this.getLocalStore(),
localStorePrototype: memoize({
instance: {},
get options() ({})
}),
/**
* @property {[Object]} The array of closed tabs for the current
* session.