remove rows from the poll

pull/1/head
ansuz 8 years ago
parent c6bdb7506d
commit 068a3f5944

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

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

@ -150,6 +150,12 @@ define([
table.removeColumn(uid); 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 makeUser = function (proxy, id, value) {
var $user = Input({ var $user = Input({
id: id, id: id,
@ -159,9 +165,19 @@ define([
proxy.table.cols[id] = $user.val() || ""; 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 || ""; proxy.table.cols[id] = value || "";
addIfAbsent(proxy.table.colsOrder, id); addIfAbsent(proxy.table.colsOrder, id);
table.addColumn($user, Checkbox, id); table.addColumn($wrapper, Checkbox, id);
return $user; return $user;
}; };
@ -174,10 +190,20 @@ define([
proxy.table.rows[id] = $option.val(); 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 || ""; proxy.table.rows[id] = value || "";
addIfAbsent(proxy.table.rowsOrder, id); addIfAbsent(proxy.table.rowsOrder, id);
table.addRow($option, Checkbox, id); var $row = table.addRow($wrapper, Checkbox, id);
return $option; return $option;
}; };

Loading…
Cancel
Save