Skip to content

Commit

Permalink
fix color feature
Browse files Browse the repository at this point in the history
  • Loading branch information
wildskyf committed Jan 21, 2018
1 parent a90657b commit ac53949
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var Memo = {
},

_createButtons: () => {
var { $delBtn, $optionBtn, _save } = Memo;
var { $newTextarea, $delBtn, $optionBtn, _save } = Memo;

// delete button
$delBtn.classList.add('delete', 'btn');
Expand All @@ -91,7 +91,7 @@ var Memo = {
$optionBtn.title = "change color";
$optionBtn.textContent = 'O';
$optionBtn.addEventListener('click', e => {
var ta_style = $optionBtn.querySelector('textarea').style;
var ta_style = $newTextarea.style;
var currentColorNo = COLORs.indexOf(ta_style.backgroundColor);
ta_style.backgroundColor = COLORs[(currentColorNo + 1) % COLORs.length];
_save();
Expand Down Expand Up @@ -132,7 +132,7 @@ var Memo = {
url: location.href,
memo_id: $newDiv.dataset['pagememoId'],
val: $newTextarea.value,
color: $newTextarea.style.backgroundColor,
color: $newTextarea.style.backgroundColor || COLORs[0],
width: $newTextarea.style.width,
position: {
x: $newDiv.style.left,
Expand Down

0 comments on commit ac53949

Please sign in to comment.