Skip to content
Extraits de code Groupes Projets
Valider 1d9f9352 rédigé par Nolan Lawson's avatar Nolan Lawson Validation de Eugen Rochko
Parcourir les fichiers

handle resize in a debounce() (#3834)

parent 53e42bf9
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -13,8 +13,6 @@ import { refreshNotifications } from '../../actions/notifications'; ...@@ -13,8 +13,6 @@ import { refreshNotifications } from '../../actions/notifications';
import UploadArea from './components/upload_area'; import UploadArea from './components/upload_area';
import ColumnsAreaContainer from './containers/columns_area_container'; import ColumnsAreaContainer from './containers/columns_area_container';
const noOp = () => false;
class UI extends React.PureComponent { class UI extends React.PureComponent {
static propTypes = { static propTypes = {
...@@ -27,9 +25,11 @@ class UI extends React.PureComponent { ...@@ -27,9 +25,11 @@ class UI extends React.PureComponent {
draggingOver: false, draggingOver: false,
}; };
handleResize = () => { handleResize = debounce(() => {
this.setState({ width: window.innerWidth }); this.setState({ width: window.innerWidth });
} }, 500, {
trailing: true,
});
handleDragEnter = (e) => { handleDragEnter = (e) => {
e.preventDefault(); e.preventDefault();
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter