Improve UI for polls on mobiles

pull/1/head
yflory 7 years ago
parent f1107ae6e5
commit c135893638

@ -111,11 +111,9 @@ table#cp-app-poll-table {
} }
#cp-app-poll-table-container { #cp-app-poll-table-container {
position: relative; position: relative;
padding: 30px 0; margin: 20px;
width: ~"calc(100% - 30px)";
} }
#cp-app-poll-table-container button { #cp-app-poll-table-container button {
//display: none;
border-radius: 0; border-radius: 0;
border: 0; border: 0;
} }
@ -148,8 +146,8 @@ table#cp-app-poll-table {
#cp-app-poll-table-scroll { #cp-app-poll-table-scroll {
overflow-y: hidden; overflow-y: hidden;
overflow-x: auto; overflow-x: auto;
margin-left: ~"calc(25% + 30px)"; margin-left: 25%;
max-width: ~"calc(75% - 30px - 100px - 100px)"; max-width: ~"calc(75% - 100px - 100px)";
width: auto; width: auto;
display: inline-block; display: inline-block;
} }
@ -227,7 +225,6 @@ table {
margin: 20px; margin: 20px;
} }
tbody { tbody {
//border: 1px solid @poll-border-color;
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
@ -298,7 +295,7 @@ div.cp-app-poll-realtime {
/* Options */ /* Options */
td:first-child { td:first-child {
position:absolute; position:absolute;
left: 30px; left: 0;
top: auto; top: auto;
width: 25%; width: 25%;
} }
@ -454,7 +451,6 @@ div.cp-app-poll-realtime {
&:nth-last-child(2) { &:nth-last-child(2) {
border-right: 1px solid @poll-border-color; border-right: 1px solid @poll-border-color;
} }
//text-align: center;
&.cp-app-poll-table-own { &.cp-app-poll-table-own {
background: @poll-th-user-bg; background: @poll-th-user-bg;
.cp-app-poll-table-lock { .cp-app-poll-table-lock {
@ -631,8 +627,42 @@ div.cp-app-poll-realtime {
} }
} }
} }
@media screen and (max-width: 500px) {
#cp-app-poll-table-scroll {
max-width: 100%;
padding: 0;
margin: 0;
table {
tr {
td {
&:first-child {
position: unset;
min-width: 100px;
&:hover:not(:empty) {
position: absolute;
min-width: 100px;
width: auto;
z-index: 100;
}
}
&:nth-last-child(2) {
position: unset;
}
&:last-child {
position: unset;
}
}
}
}
}
#cp-app-poll-comments {
min-width: 90%;
}
}
} }
.btn { .btn {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;

@ -163,11 +163,10 @@ define([
var sortColumns = function (order, firstcol) { var sortColumns = function (order, firstcol) {
var colsOrder = order.slice(); var colsOrder = order.slice();
// Never put at the first position an uncommitted column // Never put at the first position an uncommitted column
if (APP.proxy.content.colsOrder.indexOf(firstcol) === -1) { return colsOrder; } var idx = APP.proxy.content.colsOrder.indexOf(firstcol);
colsOrder.sort(function (a, b) { if (!firstcol || idx === -1) { return colsOrder; }
return (a === firstcol) ? -1 : colsOrder.splice(idx, 1);
((b === firstcol) ? 1 : 0); colsOrder.unshift(firstcol);
});
return colsOrder; return colsOrder;
}; };
@ -618,7 +617,6 @@ define([
// If readOnly, always put the app in published mode // If readOnly, always put the app in published mode
bool = true; bool = true;
} }
console.log(bool);
$(APP.$mediaTagButton).toggle(!bool); $(APP.$mediaTagButton).toggle(!bool);
setTablePublished(bool); setTablePublished(bool);
/*['textarea'].forEach(function (sel) { /*['textarea'].forEach(function (sel) {
@ -1270,7 +1268,6 @@ define([
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
common.handleNewFile(waitFor); common.handleNewFile(waitFor);
}).nThen(function (/* waitFor */) { }).nThen(function (/* waitFor */) {
console.log('here');
Test.registerInner(common.getSframeChannel()); Test.registerInner(common.getSframeChannel());
var metadataMgr = common.getMetadataMgr(); var metadataMgr = common.getMetadataMgr();
APP.locked = APP.readOnly = metadataMgr.getPrivateData().readOnly; APP.locked = APP.readOnly = metadataMgr.getPrivateData().readOnly;

Loading…
Cancel
Save