"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "app/assets/javascripts/discourse/components/site-header.js.es6" between
discourse-2.2.0.tar.gz and discourse-2.2.1.tar.gz

About: Discourse is a "next-generation" forum platform for community discussions.

site-header.js.es6  (discourse-2.2.0):site-header.js.es6  (discourse-2.2.1)
skipping to change at line 140 skipping to change at line 140
center.x < SCREEN_EDGE_MARGIN && center.x < SCREEN_EDGE_MARGIN &&
!this.$(".menu-panel").length && !this.$(".menu-panel").length &&
e.direction === "right" e.direction === "right"
) { ) {
this._animate = false; this._animate = false;
this._panMenuOrigin = "left"; this._panMenuOrigin = "left";
this._panMenuOffset = -SCREEN_OFFSET; this._panMenuOffset = -SCREEN_OFFSET;
this._isPanning = true; this._isPanning = true;
$("header.d-header").removeClass("scroll-down scroll-up"); $("header.d-header").removeClass("scroll-down scroll-up");
this.eventDispatched(this._leftMenuAction(), "header"); this.eventDispatched(this._leftMenuAction(), "header");
window.requestAnimationFrame(() => this.panMove(e));
} else if ( } else if (
windowWidth - center.x < SCREEN_EDGE_MARGIN && windowWidth - center.x < SCREEN_EDGE_MARGIN &&
!this.$(".menu-panel").length && !this.$(".menu-panel").length &&
e.direction === "left" e.direction === "left"
) { ) {
this._animate = false; this._animate = false;
this._panMenuOrigin = "right"; this._panMenuOrigin = "right";
this._panMenuOffset = -SCREEN_OFFSET; this._panMenuOffset = -SCREEN_OFFSET;
this._isPanning = true; this._isPanning = true;
$("header.d-header").removeClass("scroll-down scroll-up"); $("header.d-header").removeClass("scroll-down scroll-up");
this.eventDispatched(this._rightMenuAction(), "header"); this.eventDispatched(this._rightMenuAction(), "header");
window.requestAnimationFrame(() => this.panMove(e));
} else { } else {
this._isPanning = false; this._isPanning = false;
} }
}, },
panEnd(e) { panEnd(e) {
if (!this._isPanning) { if (!this._isPanning) {
return; return;
} }
this._isPanning = false; this._isPanning = false;
skipping to change at line 245 skipping to change at line 247
this.dispatch("header:keyboard-trigger", "header"); this.dispatch("header:keyboard-trigger", "header");
this.dispatch("search-autocomplete:after-complete", "search-term"); this.dispatch("search-autocomplete:after-complete", "search-term");
this.appEvents.on("dom:clean", () => { this.appEvents.on("dom:clean", () => {
// For performance, only trigger a re-render if any menu panels are visibl e // For performance, only trigger a re-render if any menu panels are visibl e
if (this.$(".menu-panel").length) { if (this.$(".menu-panel").length) {
this.eventDispatched("dom:clean", "header"); this.eventDispatched("dom:clean", "header");
} }
}); });
if (this.site.mobileView) { this.addTouchListeners($("body"));
$("body")
.on("pointerdown", e => this._panStart(e))
.on("pointermove", e => this._panMove(e))
.on("pointerup", e => this._panMove(e))
.on("pointercancel", e => this._panMove(e));
}
}, },
willDestroyElement() { willDestroyElement() {
this._super(...arguments); this._super(...arguments);
$("body").off("keydown.header"); $("body").off("keydown.header");
$(window).off("resize.discourse-menu-panel"); $(window).off("resize.discourse-menu-panel");
this.appEvents.off("header:show-topic"); this.appEvents.off("header:show-topic");
this.appEvents.off("header:hide-topic"); this.appEvents.off("header:hide-topic");
this.appEvents.off("dom:clean"); this.appEvents.off("dom:clean");
if (this.site.mobileView) { this.removeTouchListeners($("body"));
$("body")
.off("pointerdown")
.off("pointerup")
.off("pointermove")
.off("pointercancel");
}
Ember.run.cancel(this._scheduledRemoveAnimate); Ember.run.cancel(this._scheduledRemoveAnimate);
window.cancelAnimationFrame(this._scheduledMovingAnimation); window.cancelAnimationFrame(this._scheduledMovingAnimation);
}, },
buildArgs() { buildArgs() {
return { return {
flagCount: _flagProperties.reduce( flagCount: _flagProperties.reduce(
(prev, cur) => prev + (this.get(cur) || 0), (prev, cur) => prev + (this.get(cur) || 0),
0 0
), ),
 End of changes. 4 change blocks. 
14 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)