File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 9
9
* Initialize a Timesheet
10
10
*/
11
11
var Timesheet = function ( container , min , max , data ) {
12
- this . container = '#' + container ;
13
12
this . data = [ ] ;
14
13
this . year = {
15
14
min : min ,
19
18
this . parse ( data || [ ] ) ;
20
19
21
20
if ( typeof document !== 'undefined' ) {
21
+ this . container = document . querySelector ( '#' + container ) ;
22
22
this . drawSections ( ) ;
23
23
this . insertData ( ) ;
24
24
}
29
29
*/
30
30
Timesheet . prototype . insertData = function ( ) {
31
31
var html = [ ] ;
32
- var widthMonth = document . querySelector ( this . container + ' .scale section') . offsetWidth ;
32
+ var widthMonth = this . container . querySelector ( ' .scale section') . offsetWidth ;
33
33
34
34
for ( var n = 0 , m = this . data . length ; n < m ; n ++ ) {
35
35
var cur = this . data [ n ] ;
44
44
html . push ( '<li>' + line + '</li>' ) ;
45
45
}
46
46
47
- document . querySelector ( this . container ) . innerHTML += '<ul class="data">' + html . join ( '' ) + '</ul>' ;
47
+ this . container . innerHTML += '<ul class="data">' + html . join ( '' ) + '</ul>' ;
48
48
} ;
49
49
50
50
/**
57
57
html . push ( '<section>' + c + '</section>' ) ;
58
58
}
59
59
60
- document . querySelector ( this . container ) . className = 'timesheet color-scheme-default' ;
61
- document . querySelector ( this . container ) . innerHTML = '<div class="scale">' + html . join ( '' ) + '</div>' ;
60
+ this . container . className = 'timesheet color-scheme-default' ;
61
+ this . container . innerHTML = '<div class="scale">' + html . join ( '' ) + '</div>' ;
62
62
} ;
63
63
64
64
/**
You can’t perform that action at this time.
0 commit comments