Skip to content

Commit

Permalink
Style tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
agundermann authored and mjackson committed Jun 30, 2015
1 parent 28a49f7 commit 23c0aff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions modules/BrowserHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class BrowserHistory extends DOMHistory {
if (this.isSupported && window.history.state)
key = window.history.state.key;

super.setup(path, {key});
super.setup(path, { key });
}

handlePopState(event) {
Expand All @@ -52,7 +52,7 @@ class BrowserHistory extends DOMHistory {

var path = getWindowPath();
var key = event.state && event.state.key;
this.handlePop(path, {key});
this.handlePop(path, { key });
}

addChangeListener(listener) {
Expand Down
10 changes: 5 additions & 5 deletions modules/History.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ class History {
if (typeof this.readState === 'function')
state = this.readState(entry.key);

this._handleChange(path, state, entry, NavigationTypes.POP, false);
this._update(path, state, entry, NavigationTypes.POP, false);
}

handlePop(path, entry = {}) {
var state = null;
if (entry.key && typeof this.readState === 'function')
state = this.readState(entry.key);

this._handleChange(path, state, entry, NavigationTypes.POP);
this._update(path, state, entry, NavigationTypes.POP);
}

createRandomKey() {
Expand Down Expand Up @@ -103,7 +103,7 @@ class History {
this.constructor.name
);

this._handleChange(path, state, entry, NavigationTypes.PUSH);
this._update(path, state, entry, NavigationTypes.PUSH);
}

replaceState(state, path) {
Expand All @@ -117,7 +117,7 @@ class History {
this.constructor.name
);

this._handleChange(path, state, entry, NavigationTypes.REPLACE);
this._update(path, state, entry, NavigationTypes.REPLACE);
}

back() {
Expand All @@ -128,7 +128,7 @@ class History {
this.go(1);
}

_handleChange(path, state, entry, navigationType, notify=true) {
_update(path, state, entry, navigationType, notify=true) {
this.path = path;
this.location = this._createLocation(path, state, entry, navigationType);

Expand Down
8 changes: 4 additions & 4 deletions modules/MemoryHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class MemoryHistory extends History {
var path = entry.path;
var key = entry.key;

super.setup(path, {key, current: this.current});
super.setup(path, { key, current: this.current });
}

_createEntry(object) {
Expand All @@ -69,14 +69,14 @@ class MemoryHistory extends History {
this.current += 1;
this.entries = this.entries.slice(0, this.current).concat([{ key, path }]);

return {key, current: this.current};
return { key, current: this.current };
}

// http://www.w3.org/TR/2011/WD-html5-20110113/history.html#dom-history-replacestate
replace(path, key) {
this.entries[this.current] = { key, path };

return {key, current: this.current};
return { key, current: this.current };
}

readState(key) {
Expand All @@ -100,7 +100,7 @@ class MemoryHistory extends History {
this.current += n;
var currentEntry = this.entries[this.current];

this.handlePop(currentEntry.path, {key: currentEntry.key, current: this.current});
this.handlePop(currentEntry.path, { key: currentEntry.key, current: this.current });
}

canGo(n) {
Expand Down

0 comments on commit 23c0aff

Please sign in to comment.