Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/Stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ var Stats = function () {

var container = document.createElement( 'div' );
container.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';
container.addEventListener( 'click', function ( event ) {

var clickHandler = function ( event ) {

event.preventDefault();
showPanel( ++ mode % container.children.length );

}, false );
}

container.addEventListener( 'click', clickHandler, false );

//

Expand Down Expand Up @@ -99,6 +102,13 @@ var Stats = function () {
beginTime = this.end();

},

dispose: function () {

container.removeEventListener( 'click', clickHandler );
container.remove();

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need container.remove();? Or should we leave that part to the user?


},

// Backwards Compatibility

Expand Down