veto

Simple Sinatra voting website.
git clone git://git.knutsen.co/veto
Log | Files | Refs | README | LICENSE

commit 6ef7c0a082c03f65ebfa7c329c5e845029349625
parent 1ed896ed725a3dd477f2828d245cf6e6c86e8f7a
Author: Fredrik <moi@knutsen.co>
Date:   Sat, 27 Oct 2018 02:49:10 +0100

Merge pull request #5 from Demonstrandum/devel

Edit button and span not clickable for edit...
Diffstat:
Mviews/index.erb | 12+++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/views/index.erb b/views/index.erb @@ -72,7 +72,7 @@ $("#options") .append(` <li class="option-item"> - <span>${option}</span> + <span class="value">${option}</span> <div class="symbols"> <i class="option-edit far fa-edit"></i> <i class="option-remove fas fa-times"></i> @@ -105,7 +105,11 @@ }; $(document).on('click', e => { - if (!$(e.target).hasClass('editor') && !$(e.target).hasClass('option-item')) { + if (!( $(e.target).hasClass('editor') + || $(e.target).hasClass('option-item') + || $(e.target).hasClass('fa-save') + || $(e.target).hasClass('value') + )) { save(); editing = NaN; } @@ -124,12 +128,10 @@ $('#options').on('click', 'li', e => { if (e.target.nodeName === 'INPUT') return; - const li = $(e.currentTarget); - console.log(li.index()); + let li = $(e.currentTarget); save(); if (editing !== li.index()) { - console.log('not same click'); editing = li.index(); edit_mode(li); } else {