File tree 1 file changed +13
-9
lines changed
1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ UE.plugins['autoheight'] = function () {
53
53
isFullscreen = f
54
54
} ) ;
55
55
me . addListener ( 'destroy' , function ( ) {
56
+ domUtils . un ( me . window , "scroll" , fixedScrollTop ) ;
56
57
me . removeListener ( 'contentchange afterinserthtml keyup mouseup' , adjustHeight )
57
58
} ) ;
58
59
me . enableAutoHeight = function ( ) {
@@ -99,17 +100,20 @@ UE.plugins['autoheight'] = function () {
99
100
100
101
} ) ;
101
102
//修复内容过多时,回到顶部,顶部内容被工具栏遮挡问题
102
- var lastScrollY ;
103
- window . onscroll = function ( ) {
104
- if ( lastScrollY === null ) {
105
- lastScrollY = this . scrollY
106
- } else if ( this . scrollY == 0 && lastScrollY != 0 ) {
107
- me . window . scrollTo ( 0 , 0 ) ;
108
- lastScrollY = null ;
109
- }
110
- }
103
+ domUtils . on ( me . window , "scroll" , fixedScrollTop ) ;
111
104
} ) ;
112
105
106
+ var lastScrollY ;
107
+
108
+ function fixedScrollTop ( ) {
109
+ if ( ! me . window ) return ;
110
+ if ( lastScrollY === null ) {
111
+ lastScrollY = me . window . scrollY
112
+ } else if ( me . window . scrollY == 0 && lastScrollY != 0 ) {
113
+ me . window . scrollTo ( 0 , 0 ) ;
114
+ lastScrollY = null ;
115
+ }
116
+ }
113
117
114
118
} ;
115
119
You can’t perform that action at this time.
0 commit comments