File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -102,9 +102,12 @@ var create = function() {
102
102
styles [ i ] = this . options . containerStyles [ i ] ;
103
103
}
104
104
105
+ var cssText = '' ;
105
106
Object . keys ( styles ) . forEach ( function ( key ) {
106
- container . style . cssText += key + ':' + styles [ key ] ;
107
+ cssText += key + ':' + styles [ key ] + ';' ;
107
108
} ) ;
109
+ container . className = 'monitor-fps-board' ;
110
+ container . style . cssText = cssText ;
108
111
109
112
container . addEventListener ( 'click' , function ( e ) {
110
113
e . preventDefault ( ) ;
@@ -117,7 +120,7 @@ var create = function() {
117
120
118
121
function FPSBoard ( options ) {
119
122
var opts = options || { } ;
120
- opts . container = document . querySelector ( opts . container ) || document . body ;
123
+ opts . container = opts . container instanceof HTMLElement ? opts . container : ( document . querySelector ( opts . container ) || document . body ) ;
121
124
opts . width = opts . width || 80 ;
122
125
opts . height = opts . height || 48 ;
123
126
opts . alpha = opts . alpha || 0.9 ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " monitor.js" ,
3
- "version" : " 2.0.0 " ,
3
+ "version" : " 2.0.1 " ,
4
4
"description" : " performance monitor for browser runtime" ,
5
5
"keywords" : [
6
6
" monitor"
You can’t perform that action at this time.
0 commit comments