Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add condition to edit note with single click on mobile and double click on PC #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 29 additions & 12 deletions client/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,18 +286,35 @@ function drawNewCard(id, text, x, y, rot, colour, sticker, animationspeed) {
}
);

card.children('.content').editable(function(value, settings) {
onCardChange(id, value);
return (value);
}, {
type: 'textarea',
submit: 'OK',
style: 'inherit',
cssclass: 'card-edit-form',
placeholder: 'Double Click to Edit.',
onblur: 'submit',
event: 'dblclick', //event: 'mouseover'
});
//to edit note, single click on mobile and double click on PC
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
card.children('.content').editable(function(value, settings) {
onCardChange(id, value);
return (value);
}, {
type: 'textarea',
submit: 'OK',
style: 'inherit',
cssclass: 'card-edit-form',
placeholder: 'Click to Edit.',
onblur: 'submit',
event: 'click',
});
}
else {
card.children('.content').editable(function(value, settings) {
onCardChange(id, value);
return (value);
}, {
type: 'textarea',
submit: 'OK',
style: 'inherit',
cssclass: 'card-edit-form',
placeholder: 'Double Click to Edit.',
onblur: 'submit',
event: 'dblclick',
});
}

//add applicable sticker
if (sticker !== null)
Expand Down