diff options
| author | Teddy Wing | 2017-03-20 00:50:08 +0100 |
|---|---|---|
| committer | Teddy Wing | 2017-03-20 00:50:08 +0100 |
| commit | da8f3df2fa59dbc836bb1691509c5c8bf385f89b (patch) | |
| tree | 050956de5b5eec5bf3a764de7ae349fa20006a0c /timetasker.js | |
| parent | 9a489a61c48c0a932f3b6a7273800428e2dde92d (diff) | |
| download | chrome-timetasker-da8f3df2fa59dbc836bb1691509c5c8bf385f89b.tar.bz2 | |
timetasker.js: Fix the "billable" checkbox auto-fill
The checkbox wasn't getting filled in correctly. By some overzealous and
uncaught copy-pasting, I had wrapped the field in the function to
populate a select box. Since this is a checkbox, we want to use its
`.checked` property instead.
Use a timeout also. By default Time Task marks Billable as true/checked.
If the script unchecks the box and then the AJAX select box population
occurs, the check box re-checks itself. Adding a timeout allows it to
remain unchecked if you've set that in the user options.
Diffstat (limited to 'timetasker.js')
| -rw-r--r-- | timetasker.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/timetasker.js b/timetasker.js index 31fe526..fb653f3 100644 --- a/timetasker.js +++ b/timetasker.js @@ -39,7 +39,10 @@ function timetasker (fields) { }, 500); time_0.value = fields.time; - populate_select(billable_0, fields.billable ? 't' : 'f'); + + window.setTimeout(function() { + billable_0.checked = fields.billable; + }, 500); window.setTimeout(function() { |
