voterunner

quick and dirty votes and discussions
git clone https://git.ce9e.org/voterunner.git

commit
688932ce5f50dccd003941881eb5f7daf0022d03
parent
3a640f26fce73a9a3168586b74c88c0b8412e6cc
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-10-18 07:09
disable input on missing id or offline

Diffstat

M static/src/template.js 2 ++
M static/src/voterunner.js 5 +++++

2 files changed, 7 insertions, 0 deletions


diff --git a/static/src/template.js b/static/src/template.js

@@ -62,6 +62,8 @@ var tplNode = function(state, node) {
   62    62 					className: 'node__delegate bar__item bar__item--button bar__item--right',
   63    63 					title: 'delegate to ' + node.id,
   64    64 					disabled: (
   -1    65 						!navigator.onLine ||
   -1    66 						!state.id ||
   65    67 						node.id === state.id ||
   66    68 						getDelegationChain(state.nodes, node).includes(state.id)
   67    69 					),

diff --git a/static/src/voterunner.js b/static/src/voterunner.js

@@ -56,6 +56,11 @@ document.addEventListener('DOMContentLoaded', function() {
   56    56 		if (!state.dirty) {
   57    57 			document.querySelector('.user__comment textarea').value = user ? user.comment || '' : '';
   58    58 		}
   -1    59 
   -1    60 		var disabled = !state.id || !navigator.onLine;
   -1    61 		document.querySelector('.user__rm').disabled = disabled;
   -1    62 		document.querySelector('.user__undelegate').disabled = disabled;
   -1    63 		document.querySelector('.user__comment textarea').disabled = disabled;
   59    64 	});
   60    65 
   61    66 	utils.on(document, 'click', '.node__expand', function() {