File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -351,8 +351,13 @@ module.exports = () => {
351
351
this . dragging = 1 ;
352
352
let toListen = this . getScrollListeners ( ) ;
353
353
frameRect = CanvasView . getFrameOffset ( 1 ) ;
354
- on ( toListen , 'mousemove' , this . autoscroll ) ;
355
- on ( toListen , 'mouseup' , this . stopAutoscroll ) ;
354
+
355
+ // By detaching those from the stack avoid browsers lags
356
+ // Noticeable with "fast" drag of blocks
357
+ setTimeout ( ( ) => {
358
+ on ( toListen , 'mousemove' , this . autoscroll ) ;
359
+ on ( toListen , 'mouseup' , this . stopAutoscroll ) ;
360
+ } , 0 ) ;
356
361
} ,
357
362
358
363
autoscroll ( e ) {
Original file line number Diff line number Diff line change @@ -89,25 +89,22 @@ module.exports = Backbone.View.extend({
89
89
* @param {Boolean } active
90
90
*/
91
91
toggleSortCursor ( active ) {
92
- //console.log('disabled toggleSortCursor');
93
- //return;
94
92
var em = this . em ;
95
93
var body = document . body ;
96
94
var pfx = this . ppfx || this . pfx ;
97
95
var sortCls = pfx + 'grabbing' ;
98
96
var emBody = em ? em . get ( 'Canvas' ) . getBody ( ) : '' ;
99
- if ( active ) {
97
+
98
+ // Avoid updating body className as it causes a huge repaint
99
+ // Noticeable with "fast" drag of blocks
100
+ if ( active ) {
100
101
em && em . get ( 'Canvas' ) . startAutoscroll ( ) ;
101
- body . className += ' ' + sortCls ;
102
- if ( em ) {
103
- emBody . className += ' ' + sortCls ;
104
- }
102
+ //body.className += ' ' + sortCls;
103
+ //if (em) emBody.className += ' ' + sortCls;
105
104
} else {
106
105
em && em . get ( 'Canvas' ) . stopAutoscroll ( ) ;
107
- body . className = body . className . replace ( sortCls , '' ) . trim ( ) ;
108
- if ( em ) {
109
- emBody . className = emBody . className . replace ( sortCls , '' ) . trim ( ) ;
110
- }
106
+ //body.className = body.className.replace(sortCls, '').trim();
107
+ //if(em) emBody.className = emBody.className.replace(sortCls, '').trim();
111
108
}
112
109
} ,
113
110
You can’t perform that action at this time.
0 commit comments