-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Closed
Mobile improvements #3726
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ef99cde
colibris: fixs toolbar popup (settings, embed, import...) and chat on…
seballot f028bf8
colibris: fixs timeslider on mobile
seballot 6eed4c5
colibris: on mobile, use + button to display the missing formatting i…
seballot e15df17
no-skin: toolbar restore mobile original behavior (display all icons)
seballot dac9811
colibris: fix embedded_hyperlink in mobile
seballot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(){ | ||
clearTimeout(timer); | ||
timer = setTimeout(checkAllIconAreDisplayedInToolbar, 100); | ||
}; | ||
setTimeout(checkAllIconAreDisplayedInToolbar, 300); | ||
setTimeout(checkAllIconAreDisplayedInToolbar, 600); | ||
Comment on lines
+16
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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:
etherpad-lite/src/static/js/pad_editbar.js
Lines 146 to 148 in 695c2d2