aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/utils.jsx.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/js/components/utils.jsx.js')
-rw-r--r--web/src/js/components/utils.jsx.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/web/src/js/components/utils.jsx.js b/web/src/js/components/utils.jsx.js
index 12775adc..81ba6b4d 100644
--- a/web/src/js/components/utils.jsx.js
+++ b/web/src/js/components/utils.jsx.js
@@ -51,6 +51,7 @@ var Splitter = React.createClass({
this.setState({
applied: true
});
+ this.onResize();
},
onMouseMove: function (e) {
var dX = 0, dY = 0;
@@ -61,6 +62,13 @@ var Splitter = React.createClass({
}
this.getDOMNode().style.transform = "translate(" + dX + "px," + dY + "px)";
},
+ onResize: function () {
+ // Trigger a global resize event. This notifies components that employ virtual scrolling
+ // that their viewport may have changed.
+ window.setTimeout(function () {
+ window.dispatchEvent(new CustomEvent("resize"));
+ }, 1);
+ },
reset: function (willUnmount) {
if (!this.state.applied) {
return;
@@ -77,7 +85,7 @@ var Splitter = React.createClass({
applied: false
});
}
-
+ this.onResize();
},
componentWillUnmount: function () {
this.reset(true);
@@ -104,9 +112,9 @@ function getCookie(name) {
var xsrf = $.param({_xsrf: getCookie("_xsrf")});
//Tornado XSRF Protection.
-$.ajaxPrefilter(function(options){
- if(options.type === "post" && options.url[0] === "/"){
- if(options.data){
+$.ajaxPrefilter(function (options) {
+ if (options.type === "post" && options.url[0] === "/") {
+ if (options.data) {
options.data += ("&" + xsrf);
} else {
options.data = xsrf;