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

Mobile improvements #3726

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions src/static/css/pad.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ a img {
float: left;
margin-left: 2px;
height:32px;
cursor: pointer;
}
.toolbar ul li.separator {
border: inherit;
Expand Down Expand Up @@ -187,8 +188,8 @@ a img {
outline: none;
}
.toolbar ul.menu_left {
left:0px;
right:250px;
left: 0px;
right: 210px;
}

.toolbar ul.menu_right {
Expand Down Expand Up @@ -1113,7 +1114,7 @@ input[type=checkbox] {
border-bottom: 1px solid #ccc;
z-index: 10;
}
.toolbar ul.menu_right {
.toolbar ul.menu_right, .timeslider-bar .editbarright {
right:0px !important;
height: 32px;
position: fixed;
Expand Down
3 changes: 1 addition & 2 deletions src/static/js/pad_editbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,8 @@ var padeditbar = (function()
redrawHeight: function(){
var minimunEditbarHeight = self.calculateEditbarHeight();
var editbarHeight = minimunEditbarHeight + 1 + "px";
var containerTop = minimunEditbarHeight + 6 + "px";
var containerTop = minimunEditbarHeight + 1 + "px";
$('#editbar').css("height", editbarHeight);

$('#editorcontainer').css("top", containerTop);

// make sure pop ups are in the right place
Expand Down
3 changes: 2 additions & 1 deletion src/static/skins/colibris/pad.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ h1,
.yui-skin-sam .yui-panel .hd,
p[data-l10n-id="ep_comments_page.comment"],
.comment-reply-input-label span,
.stepper, #importmessageabiword, #importmessageabiword > a
.stepper, #importmessageabiword, #importmessageabiword > a,
.toolbar .show-more-icon-btn
{ color: #64d29b; }
#ui-slider-handle, #playpause_button_icon {
background-color: #64d29b;
Expand Down
28 changes: 28 additions & 0 deletions src/static/skins/colibris/pad.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
function customStart()
{
$('#pad_title').show();

var showMoreIconBtn = $('<span class="show-more-icon-btn"></span>')
showMoreIconBtn.click(function() {
$('.toolbar').toggleClass('full-icons');
$('#editorcontainer').css('top', $('.menu_left').height() + 1 + 'px');
})
$('.toolbar').append(showMoreIconBtn)

var timer;
// on resize end
window.onresize = function(){
Copy link
Contributor

@muxator muxator Mar 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As said in the discussion, hooking on a window resize event is never a good idea. @seballot already explained why he had to do this.

For reference @JohnMcLear had to do the same in 2014 in commit 0685e56 ("working on resize"), for similar reasons. That code is still there in 2020 in the current development version:

$(window).resize(function(){
self.redrawHeight();
});

clearTimeout(timer);
timer = setTimeout(checkAllIconAreDisplayedInToolbar, 100);
};
setTimeout(checkAllIconAreDisplayedInToolbar, 300);
setTimeout(checkAllIconAreDisplayedInToolbar, 600);
Comment on lines +16 to +19
Copy link
Contributor

@muxator muxator Mar 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relying on timing for adjusting the layout is too risky.

We are sure that there will be quirks with different device speed / browser combinations.

This is the real reason for which the PR cannot be accepted in its current form.

}

function checkAllIconAreDisplayedInToolbar()
{
// reset style
$('.toolbar').removeClass('cropped')
console.log("check icons displayed", $('.toolbar .menu_left')[0].scrollWidth, $('.toolbar').width());

if ($('.toolbar .menu_left')[0].scrollWidth > $('.toolbar').width()) {
console.log("button are hidden");
$('.toolbar').addClass('cropped');
}
}
6 changes: 4 additions & 2 deletions src/static/skins/colibris/src/components/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@
bottom: 44px;
}

#chatbox {
width: 100%;
#chatbox, #chatbox.stickyChat {
width: 100% !important;
height: 50% !important;
top: initial !important;
right: 0;
}

Expand Down
35 changes: 35 additions & 0 deletions src/static/skins/colibris/src/components/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

.popup h1 {
margin-bottom: 15px;
font-size: 2em !important;
}

.popup h2 {
Expand All @@ -28,3 +29,37 @@
margin: 10px 0;
}

@media (max-width: 720px) {
.popup .column {
width: 100%;
margin-bottom: 20px;
}
.popup #exportColumn {
padding: 0;
width: 100%;
}
.popup .exportlink {
margin: 0 0 10px 0;
}

.popup h1 { font-size: 1.8em !important; }

#connectivity, #embed, #import_export, #settings, #users, #mycolorpicker, #chatbox {
bottom: 44px !important;
box-shadow: 0 0 0 1px rgba(99,114,130,.16), 3px -7px 20px 6px rgba(27, 39, 51, 0.16);
border-radius: 0 !important;
}
#connectivity, #embed, #import_export, #settings, #users, #mycolorpicker {
right: 0 !important;
overflow-y: auto;
top: initial !important;
max-height: 70%;
}
#users {
height: auto !important;
}
#embed { padding-bottom: 30px; }

#embedreadonly { margin-top: 8px; }
}

56 changes: 51 additions & 5 deletions src/static/skins/colibris/src/components/toolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
margin: 0;
background-color: white !important;
background: none;
border: 1px solid #d2d2d2
border: none;
border-bottom: 1px solid #d2d2d2
}

.toolbar .buttonicon {
Expand Down Expand Up @@ -101,16 +102,19 @@
height: 39px;
background: none;
background-color: transparent;
overflow-x: visible;
}
.toolbar ul.menu_right li {
margin-left: 10px;
}
.toolbar ul.menu_left {
padding: 2px 0 0 0;
}
.toolbar ul.menu_right {
.toolbar ul.menu_right, .timeslider-bar .editbarright {
left: 0;
padding-left: 8px;
padding-top: 8px;
height: 35px !important;
border: none;
border-top: 1px solid #d2d2d2;
background-color: white;
}
Expand All @@ -128,8 +132,6 @@
}
.toolbar ul li a:hover { background-color: transparent; }

#connectivity, #embed, #import_export, #settings { bottom: 42px; }

li.superscript,
li.subscript,
li[data-key="undo"],
Expand All @@ -138,6 +140,50 @@
}

.toolbar ul li.separator { margin: 0; }

.toolbar .show-more-icon-btn {
display:none;
height: 39px;
width: 39px;
line-height: 39px;
text-align: center;
font-weight: bold;
font-size: 2rem;
background-color: white;
z-index: 20;
}

.toolbar.cropped .menu_left {
width: calc(100% - 39px); /* Space for show-more-icon-button */
display: block;
}
.toolbar.cropped .show-more-icon-btn {
display: block;
position: absolute;
border-bottom: 1px solid #d2d2d2;
right: 0;
top: 0;
}
.toolbar.cropped .show-more-icon-btn:after {
content: "+";
}

.toolbar.full-icons {
height: auto !important;
}
.toolbar.full-icons .show-more-icon-btn {
border-bottom: none;
}
.toolbar.full-icons .show-more-icon-btn:after {
content: "-";
}
.toolbar.full-icons .menu_left {
display: flex;
flex-wrap: wrap;
height: auto;
width: 100%;
background-color: white;
}
}


11 changes: 0 additions & 11 deletions src/static/skins/colibris/src/components/users.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,8 @@ table#otheruserstable {
}

@media (max-width: 720px) {
#users {
bottom: 42px;
top: initial !important;
height: auto !important;
}

#mycolorpicker {
width: auto;
height: auto;
right: 0;
bottom: 42px;
left: initial;
top: initial !important;
}
}

Expand Down
9 changes: 8 additions & 1 deletion src/static/skins/colibris/src/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
}

#editorcontainer {
top: 41px !important;
padding-top: 0 !important;
}

Expand All @@ -28,6 +27,14 @@
#outerdocbody.plugin-ep_author_neat {
padding-left: 120px; /* more space for sidediv */
}
@media (max-width: 720px) {
#editorcontainer {
width: 100% !important;
right: 0 !important;
left: 0 !important;
}
}

@media (max-width:600px) {
#outerdocbody.plugin-ep_author_neat { padding-left: 0; }
#options-linenoscheck { display:none; }
Expand Down
13 changes: 12 additions & 1 deletion src/static/skins/colibris/src/plugins/embedded_hyperlinks.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,15 @@
margin-top: 1px;
margin-right: 0;
margin-left: 2px;
}
}
@media (max-width: 720px) {
.hyperlink-dialog {
left: 0 !important;
right: 0 !important;
padding: 10px;
display: flex;
}
.hyperlink-dialog .hyperlink-url {
flex: 1 auto;
}
}
57 changes: 49 additions & 8 deletions src/static/skins/colibris/timeslider.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
}
}

.timeslider #import_export, .timeslider #settings{
top: 108px !important;
right: 55px;
@media (min-width: 721px) {
.timeslider #import_export, .timeslider #settings{
top: 108px !important;
right: 55px;
}
}

.timeslider #export > p {
Expand All @@ -30,10 +32,12 @@
.timeslider-bar { background: none; }
.timeslider-bar p { margin: 8px; font-size: 12px;}

.timeslider-bar #editbar {
border: none;
background: none !important;
margin-right: 10px;
@media (min-width: 721px) {
.timeslider-bar #editbar {
border: none;
background: none !important;
margin-right: 10px;
}
}

.timeslider #padmain {
Expand All @@ -49,7 +53,7 @@
}

.timeslider #editorcontainerbox {
height: 100%;
min-height: 100%;
overflow: visible;
margin-top: 0 !important;
}
Expand Down Expand Up @@ -139,4 +143,41 @@
.timeslider #authorsList .author {
padding: 2px 5px;
border-radius: 3px;
}

@media (max-width: 720px) {
.timeslider-bar #editbar {
padding: 3px 0px 5px 10px;
}
.timeslider-bar #editbar ul {
display: flex;
justify-content: flex-end;
}
.timeslider-bar #editbar ul li {
margin-left: 10px;
}
.timeslider #editbar .grouped-right {
margin: 0 !important;
}
.editbar-title h1 {
font-size: 1.8em !important;
}
#timeslider {
margin: -5px 0 -2px 0 !important;
}
#timeslider #timeslider-slider { margin: 0; }
#ui-slider-bar {
margin-right: 130px;
}
.timeslider #leftstep { right: 35px; }
.timeslider #rightstep { right: 5px; }
.timeslider #playpause_button { right: 65px; }
#timeslider #timer {
top: 5px;
left: 5px;
text-align: left;
}
.timeslider #editorcontainerbox {
padding-bottom: 55px !important;
}
}
5 changes: 5 additions & 0 deletions src/static/skins/no-skin/pad.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@
#sidediv {
display: none !important;
}
}
@media only screen and (max-width: 720px) {
.toolbar ul.menu_left {
flex-wrap: wrap;
}
}
Loading