-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Making the PIN panel collapsable would get better experience. #1898
Comments
After you guys clone or download this repo and run //----------------------------------------------------------------------------------
//add toggle icon to the menu
window.onload = function(){
var MenuPins = document.getElementById('menu-pins');
var MenuPaneHeader = MenuPins.querySelectorAll('.menu-pane-header')[0];
var MenuPaneHeaderToggle = document.createElement('span');
var MenuPaneHeaderToggleIcon = document.createTextNode('◢');
MenuPaneHeaderToggle.appendChild(MenuPaneHeaderToggleIcon);
MenuPaneHeaderToggle.setAttribute('class','MenuPinsNormal MenuPinsNormalCollpase');
MenuPaneHeaderToggle.setAttribute('id','MenuPaneHeaderToggle');
MenuPaneHeaderToggle.onclick = MenuPinsToggle; //add event that toggles the pin list
MenuPaneHeader.appendChild(MenuPaneHeaderToggle);
};
//toggle the MenuPinsList
function MenuPinsToggle(){
var MenuPinsList = document.getElementById('menu-pins-list');
var MenuPaneHeaderToggle = document.getElementById('MenuPaneHeaderToggle');
if(MenuPinsList.style.display === 'none'){
MenuPinsList.style.display = 'block';
MenuPaneHeaderToggle.setAttribute('class','MenuPinsNormal MenuPinsNormalCollpase');
}else{
MenuPinsList.style.display = 'none';
MenuPaneHeaderToggle.setAttribute('class','MenuPinsNormal');
}
} And in the .MenuPinsNormal {
cursor: pointer;
position: absolute;
right:0px;
display: inline-block;
transform: rotate(45deg) translate(-15px, 10px);
}
.MenuPinsNormalCollpase {
transform: rotate(-45deg) translate(-15px, -15px);
} |
@peterzhangsnail would you be interested in making a PR to https://github.com/bterlson/ecmarkup to add that functionality? |
It has flaws. The solution mentioned before only solves this problem on PC. How it may look on the mobile device has not been tested. So a thorough test is necessary. And to your invitation, the answer is yes, of course. |
@ljharb I have been running a few tests and make sure that all the media rules get considered. It seems fine to me now. Then replace |
If that could be done in ecmarkup itself, rather than just in this repo, that would be ideal. |
@ljharb It can be done, just need to add a file 'pinCollpase.js' to replace the two files with our updated files and change the build script in the |
@ljharb Here's the |
Any chance you could make a PR to ecmarkup for that? |
@ljharb Launch a pull request there, just waiting for the owner's test and merge. |
First of all, the idea of providing a human-readable version is remarkable, thank you, guys! It just happens when you want to pin a lot of links to do a comparison or summarizing. The PIN panel would take over all the room of the sidebar and making it hard to handle the TOC.
The text was updated successfully, but these errors were encountered: