remove rows from the poll

This commit is contained in:
ansuz 2016-07-22 15:42:41 +02:00
parent c6bdb7506d
commit 068a3f5944
3 changed files with 54 additions and 18 deletions

View file

@ -179,7 +179,7 @@ tbody tr th:last-child {
border-right: 0px;
}
tbody .remove {
cursor: pointer;
cursor: pointer !important;
color: #FF0073;
}
tbody td {
@ -264,9 +264,12 @@ form.realtime table {
}
form.realtime table input {
height: 100%;
width: 100%;
width: 90%;
border: 3px solid #302B28;
display: table-cell;
}
form.realtime table thead tr th .remove {
color: #FF0073;
cursor: pointer;
}
form.realtime table tfoot tr td {
z-index: 4000;
@ -312,9 +315,12 @@ div.modal table {
}
div.modal table input {
height: 100%;
width: 100%;
width: 90%;
border: 3px solid #302B28;
display: table-cell;
}
div.modal table thead tr th span.remove {
color: red;
cursor: pointer;
}
div.modal table tfoot tr td {
z-index: 4000;

View file

@ -211,7 +211,7 @@ tbody {
}
}
.remove {
cursor: pointer;
cursor: pointer !important;
color: @cp-red;
}
@ -324,15 +324,19 @@ form.realtime {
input {
height: 100%;
width: 100%;
width: 90%;
border: 3px solid @base;
display: table-cell;
//display: table-cell;
}
thead {
tr {
td {
th {
.remove {
color: @cp-red;
cursor: pointer;
}
}
}
@ -347,7 +351,6 @@ form.realtime {
tfoot {
tr {
td {
z-index: 4000;
cursor: pointer;
}
@ -389,7 +392,6 @@ div.modal {
border: 1px solid @light-base;
text-align: center;
}
&.shown {
@ -409,16 +411,18 @@ div.modal {
input {
height: 100%;
width: 100%;
width: 90%;
border: 3px solid @base;
display: table-cell;
//display: table-cell;
}
thead {
tr {
td {
th {
span.remove {
color: red;
cursor: pointer;
}
}
}
}

View file

@ -150,6 +150,12 @@ define([
table.removeColumn(uid);
};
var removeFromArray = function (A, e) {
var i = A.indexOf(e);
if (i === -1) { return; }
A.splice(i, 1);
};
var makeUser = function (proxy, id, value) {
var $user = Input({
id: id,
@ -159,9 +165,19 @@ define([
proxy.table.cols[id] = $user.val() || "";
});
var $wrapper = $('<div>')
.append($user)
.append($('<span>', {
'class': 'remove',
'title': 'remove column', // TODO translate
}).text('✖').click(function () {
removeColumn(proxy, id);
table.removeColumn(id);
}))
proxy.table.cols[id] = value || "";
addIfAbsent(proxy.table.colsOrder, id);
table.addColumn($user, Checkbox, id);
table.addColumn($wrapper, Checkbox, id);
return $user;
};
@ -174,10 +190,20 @@ define([
proxy.table.rows[id] = $option.val();
});
var $wrapper = $('<div>')
.append($option)
.append($('<span>', {
'class': 'remove',
'title': 'remove row', // TODO translate
}).text('✖').click(function () {
removeRow(proxy, id);
table.removeRow(id);
}));
proxy.table.rows[id] = value || "";
addIfAbsent(proxy.table.rowsOrder, id);
table.addRow($option, Checkbox, id);
var $row = table.addRow($wrapper, Checkbox, id);
return $option;
};