Giter Club home page Giter Club logo

Comments (19)

rpkamp avatar rpkamp commented on June 25, 2024

I don't know what you're seeing on your end, but here the AdGuard popup is 598px tall.

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 25, 2024

But AdGuard pop-up is higher for some reason.
2019-01-22_185131

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 25, 2024

If to change this max-height value to 600px then pop-up height is so big as in AdGuard. In preferences it is 600px but in reality it is always 562px. There seems to be a bug in css.
image

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 25, 2024

Somethimes it is 513px. Why isn't it static? Size of Chrome window wasn't reduced in these cases.
image

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 25, 2024

I think that real max-height should be static for all variants of window size.
Now real pop-up height is almost always different while Chrome window size is the same.
If you want to use depending of Chrome window size then the best and reliable way is to use proportion:
screen.availHeight / Preferred_height = window.outerHeight / max_height
max_height = Preferred_height * window.outerHeight / screen.availHeight
elem.style.maxHeight = max_height+"px"

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on June 25, 2024

Sounds like you have a grasp on this. Feel free to create a PR 🙂

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 25, 2024

I have never made a PR yet.
You can fix this for 5 minutes.
But for me it is need at least several hours to analyze its big code with many modules to not break something.
So please fix this yourself. You know how your extension works. This problem is very annoying because height is somethimes small, somethimes medium but it is never 600px (((
But I can help with any problem if it will be.

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 25, 2024

I have made a quick fix for this problem. But I want to check it firstly. If to load the extension from scr folder to Chrome - it doesn't work.
Can your give working uncompressed version of the extension?

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on June 25, 2024

This repository is an uncompressed working version of the extension 🙂

See the README for instructions on how to get started.

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 25, 2024

I don't want to play with modules, install programs and learn how to make it working. I don't understand the instruction.
Please give here the working uncompressed extension in zip archive (which is ready for installing in Chrome) and I will give the fix after checking.

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on June 25, 2024

That's not really workable, as I'd have to reverse engineer what you did, which would take a lot of time.

I'll look into this later.

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 25, 2024

I just need uncompressed ready version. I don't understand the sense of the problem you describe but just need to assemble it as you did before, but without compressing.
The fix is only in function setElementDimensions(). But it is problematic to find this function in the version from chrome store.

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on June 25, 2024

If you could post your correct setElementDimensions here I'd be happy to put it in.

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 25, 2024

It should work. But I am not sure for 100 % without checking.

function setElementDimensions(tab, selector, preferredWidth, preferredHeight, zoom) {
  var height, width;
  chrome.windows.getCurrent(function(e) {
    if (e.state == "maximized" || e.state == "fullscreen") {
      height = preferredHeight;
      width = preferredWidth;
    } else {
    height = Math.round(preferredHeight * e.height / screen.availHeight);
    width = Math.round(preferredWidth * e.width / screen.availWidth);
    }
  })

  const elem = document.querySelector(selector);
  if (elem === null) {
    return;
  }

  elem.style.width = `${width}px`;
  elem.style.minWidth = `${width}px`;
  elem.style.maxWidth = `${width}px`;
  elem.style.maxHeight = `${height}px`;
}

So here is used chrome window api to know window format. If its size is reduced - the proportion is used to make the percentage ratio of pop-up area and window area the same.

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on June 25, 2024

Okay I think I found the issue. MBT was trying to be nice and leave at least 100px free at the bottom of the screen, and it would lower the max-height for that to a value lower than the user indicated.

I've created a new version that no longer tries to be nice and just sets max-height to whatever the user set it to, and chrome can then figure out what the actual height should be.

I've just published the new version, it should arrive at your device within the next hour. Could you please verify that this works better?

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 25, 2024

BTW the thing was not in lowering the max-height but in fact that the max-height was different for different tabs while the window was the same size. It was really strange. So 100px is not the only reason.
But now it is static. Thanks.
I thought that you tried to make depending on window size. But I think it is better when it is always static as now.

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on June 25, 2024

Cool. I'll consider this closed then 👍

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 25, 2024

Please explain what is "Animation speed"? I tried many times to see it but I don't understand where should it work.

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on June 25, 2024

It changes the speed with which folders expand/collapse.

from chrome-minimal-bookmarks-tree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.