Skip to content

Commit

Permalink
Merge branch 'olivierrr-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
sbstjn committed Sep 15, 2014
2 parents eb7fe56 + 0525e01 commit 45d485c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/timesheet.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions source/javascripts/timesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Initialize a Timesheet
*/
var Timesheet = function(container, min, max, data) {
this.container = '#' + container;
this.data = [];
this.year = {
min: min,
Expand All @@ -19,6 +18,7 @@
this.parse(data || []);

if (typeof document !== 'undefined') {
this.container = (typeof container === 'string') ? document.querySelector('#'+container) : container;
this.drawSections();
this.insertData();
}
Expand All @@ -29,7 +29,7 @@
*/
Timesheet.prototype.insertData = function() {
var html = [];
var widthMonth = document.querySelector(this.container + ' .scale section').offsetWidth;
var widthMonth = this.container.querySelector('.scale section').offsetWidth;

for (var n = 0, m = this.data.length; n < m; n++) {
var cur = this.data[n];
Expand All @@ -44,7 +44,7 @@
html.push('<li>' + line + '</li>');
}

document.querySelector(this.container).innerHTML += '<ul class="data">' + html.join('') + '</ul>';
this.container.innerHTML += '<ul class="data">' + html.join('') + '</ul>';
};

/**
Expand All @@ -57,8 +57,8 @@
html.push('<section>' + c + '</section>');
}

document.querySelector(this.container).className = 'timesheet color-scheme-default';
document.querySelector(this.container).innerHTML = '<div class="scale">' + html.join('') + '</div>';
this.container.className = 'timesheet color-scheme-default';
this.container.innerHTML = '<div class="scale">' + html.join('') + '</div>';
};

/**
Expand Down

0 comments on commit 45d485c

Please sign in to comment.