|
|
@ -91,6 +91,7 @@ define([
|
|
|
|
$('input[disabled="disabled"][data-rt-id^="' + id + '"]').removeAttr('disabled');
|
|
|
|
$('input[disabled="disabled"][data-rt-id^="' + id + '"]').removeAttr('disabled');
|
|
|
|
$('input[type="checkbox"][data-rt-id^="' + id + '"]').addClass('enabled');
|
|
|
|
$('input[type="checkbox"][data-rt-id^="' + id + '"]').addClass('enabled');
|
|
|
|
$('[data-rt-id="' + id + '"] ~ .edit').css('visibility', 'hidden');
|
|
|
|
$('[data-rt-id="' + id + '"] ~ .edit').css('visibility', 'hidden');
|
|
|
|
|
|
|
|
$('.lock[data-rt-id="' + id + '"]').html('🔓');
|
|
|
|
|
|
|
|
|
|
|
|
if (isOwnColumnCommitted()) { return; }
|
|
|
|
if (isOwnColumnCommitted()) { return; }
|
|
|
|
$('[data-rt-id^="' + id + '"]').closest('td').addClass("uncommitted");
|
|
|
|
$('[data-rt-id^="' + id + '"]').closest('td').addClass("uncommitted");
|
|
|
@ -108,11 +109,12 @@ define([
|
|
|
|
$('input[disabled="disabled"][data-rt-id^="' + id + '"]').removeAttr('disabled');
|
|
|
|
$('input[disabled="disabled"][data-rt-id^="' + id + '"]').removeAttr('disabled');
|
|
|
|
$('input[type="checkbox"][data-rt-id^="' + id + '"]').addClass('enabled');
|
|
|
|
$('input[type="checkbox"][data-rt-id^="' + id + '"]').addClass('enabled');
|
|
|
|
$('span.edit[data-rt-id="' + id + '"]').css('visibility', 'hidden');
|
|
|
|
$('span.edit[data-rt-id="' + id + '"]').css('visibility', 'hidden');
|
|
|
|
|
|
|
|
$('.lock[data-rt-id="' + id + '"]').html('🔓');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var updateTableButtons = function () {
|
|
|
|
var updateTableButtons = function () {
|
|
|
|
if ($('.checkbox-cell').length && !isOwnColumnCommitted()) {
|
|
|
|
if (!isOwnColumnCommitted()) {
|
|
|
|
$('#commit').show();
|
|
|
|
$('#commit').show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -246,9 +248,12 @@ define([
|
|
|
|
var isRemove = span.className && span.className.split(' ').indexOf('remove') !== -1;
|
|
|
|
var isRemove = span.className && span.className.split(' ').indexOf('remove') !== -1;
|
|
|
|
var isEdit = span.className && span.className.split(' ').indexOf('edit') !== -1;
|
|
|
|
var isEdit = span.className && span.className.split(' ').indexOf('edit') !== -1;
|
|
|
|
if (isRemove) {
|
|
|
|
if (isRemove) {
|
|
|
|
|
|
|
|
Cryptpad.confirm(Messages.poll_removeOption, function (res) {
|
|
|
|
|
|
|
|
if (!res) { return; }
|
|
|
|
Render.removeRow(APP.proxy, id, function () {
|
|
|
|
Render.removeRow(APP.proxy, id, function () {
|
|
|
|
change();
|
|
|
|
change();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
} else if (isEdit) {
|
|
|
|
} else if (isEdit) {
|
|
|
|
unlockRow(id, function () {
|
|
|
|
unlockRow(id, function () {
|
|
|
|
change();
|
|
|
|
change();
|
|
|
@ -258,9 +263,12 @@ define([
|
|
|
|
var isRemove = span.className && span.className.split(' ').indexOf('remove') !== -1;
|
|
|
|
var isRemove = span.className && span.className.split(' ').indexOf('remove') !== -1;
|
|
|
|
var isEdit = span.className && span.className.split(' ').indexOf('edit') !== -1;
|
|
|
|
var isEdit = span.className && span.className.split(' ').indexOf('edit') !== -1;
|
|
|
|
if (isRemove) {
|
|
|
|
if (isRemove) {
|
|
|
|
|
|
|
|
Cryptpad.confirm(Messages.poll_removeUser, function (res) {
|
|
|
|
|
|
|
|
if (!res) { return; }
|
|
|
|
Render.removeColumn(APP.proxy, id, function () {
|
|
|
|
Render.removeColumn(APP.proxy, id, function () {
|
|
|
|
change();
|
|
|
|
change();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
} else if (isEdit) {
|
|
|
|
} else if (isEdit) {
|
|
|
|
unlockColumn(id, function () {
|
|
|
|
unlockColumn(id, function () {
|
|
|
|
change();
|
|
|
|
change();
|
|
|
@ -277,9 +285,10 @@ define([
|
|
|
|
if ($(e.target).is('[type="text"]')) {
|
|
|
|
if ($(e.target).is('[type="text"]')) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$('.lock[data-rt-id!="' + APP.userid + '"]').html('🔒 ');
|
|
|
|
var $cells = APP.$table.find('thead td:not(.uncommitted), tbody td');
|
|
|
|
var $cells = APP.$table.find('thead td:not(.uncommitted), tbody td');
|
|
|
|
$cells.find('[type="text"][data-rt-id!="' + APP.userid + '"]').attr('disabled', true);
|
|
|
|
$cells.find('[type="text"][data-rt-id!="' + APP.userid + '"]').attr('disabled', true);
|
|
|
|
$cells.find('[data-rt-id!="' + APP.userid + '"] ~ .edit').css('visibility', 'visible');
|
|
|
|
$('.edit[data-rt-id!="' + APP.userid + '"]').css('visibility', 'visible');
|
|
|
|
APP.editable.col = [APP.userid];
|
|
|
|
APP.editable.col = [APP.userid];
|
|
|
|
APP.editable.row = [];
|
|
|
|
APP.editable.row = [];
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -294,14 +303,13 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
if (isKeyup) {
|
|
|
|
if (isKeyup) {
|
|
|
|
console.log("Keyup!");
|
|
|
|
console.log("Keyup!");
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!target) { return void console.log("NO TARGET"); }
|
|
|
|
if (!target) { return void console.log("NO TARGET"); }
|
|
|
|
|
|
|
|
|
|
|
|
var nodeName = target && target.nodeName;
|
|
|
|
var nodeName = target && target.nodeName;
|
|
|
|
|
|
|
|
|
|
|
|
if (!$(target).parents('#table tbody').length) {
|
|
|
|
if (!$(target).parents('#table tbody').length || $(target).hasClass('edit')) {
|
|
|
|
hideInputs(e);
|
|
|
|
hideInputs(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|