summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web-ui/app/js/page/router.js8
-rw-r--r--web-ui/test/spec/page/router.spec.js6
2 files changed, 7 insertions, 7 deletions
diff --git a/web-ui/app/js/page/router.js b/web-ui/app/js/page/router.js
index 9b2516b0..3de2bba9 100644
--- a/web-ui/app/js/page/router.js
+++ b/web-ui/app/js/page/router.js
@@ -38,14 +38,14 @@ define(['flight/lib/component', 'page/events', 'page/router/url_params'], functi
};
}
- this.smailPushState = function (ev, data) {
+ this.pushState = function (ev, data) {
if (!data.fromPopState) {
var nextState = createState(data, this.attr.history.state);
this.attr.history.pushState(nextState, '', createHash(nextState));
}
};
- this.smailPopState = function (ev) {
+ this.popState = function (ev) {
var state = ev.state || {};
this.trigger(document, events.ui.tag.select, {
@@ -60,8 +60,8 @@ define(['flight/lib/component', 'page/events', 'page/router/url_params'], functi
};
this.after('initialize', function () {
- this.on(document, events.router.pushState, this.smailPushState);
- window.onpopstate = this.smailPopState.bind(this);
+ this.on(document, events.router.pushState, this.pushState);
+ window.onpopstate = this.popState.bind(this);
});
});
});
diff --git a/web-ui/test/spec/page/router.spec.js b/web-ui/test/spec/page/router.spec.js
index 7340ecad..129e0dfb 100644
--- a/web-ui/test/spec/page/router.spec.js
+++ b/web-ui/test/spec/page/router.spec.js
@@ -45,7 +45,7 @@ describeComponent('page/router', function () {
var selectTagEvent = spyOnEvent(document, Pixelated.events.ui.tag.select);
- this.component.smailPopState({ state: {tag: undefined} });
+ this.component.popState({ state: {tag: undefined} });
expect(selectTagEvent).toHaveBeenTriggeredOnAndWith(document, jasmine.objectContaining({ tag: 'tag'}));
});
@@ -56,11 +56,11 @@ describeComponent('page/router', function () {
var displayNoMessageEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelectedWithoutPushState);
- this.component.smailPopState({ state: {tag: undefined, isDisplayNoMessageSelected: false} });
+ this.component.popState({ state: {tag: undefined, isDisplayNoMessageSelected: false} });
expect(displayNoMessageEvent).not.toHaveBeenTriggeredOn(document);
- this.component.smailPopState({ state: {tag: undefined, isDisplayNoMessageSelected: true} });
+ this.component.popState({ state: {tag: undefined, isDisplayNoMessageSelected: true} });
expect(displayNoMessageEvent).toHaveBeenTriggeredOn(document);
});