mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 10:32:39 +08:00
Merge pull request #1047 from zilongshanren/fix-scrollview-content-null-1.2
only register event when content is not null
This commit is contained in:
@@ -1339,7 +1339,9 @@ var ScrollView = cc.Class({
|
||||
this._calculateBoundary();
|
||||
//Because widget component will adjust content position and scrollview position is correct after visit
|
||||
//So this event could make sure the content is on the correct position after loading.
|
||||
cc.director.once(cc.Director.EVENT_AFTER_VISIT, this._adjustContentOutOfBoundary, this);
|
||||
if(this.content) {
|
||||
cc.director.once(cc.Director.EVENT_AFTER_VISIT, this._adjustContentOutOfBoundary, this);
|
||||
}
|
||||
},
|
||||
|
||||
onDestroy: function() {
|
||||
|
||||
Reference in New Issue
Block a user