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

Padding-right on body can't be switched off #197

Closed
kurnev opened this issue Aug 17, 2018 · 5 comments
Closed

Padding-right on body can't be switched off #197

kurnev opened this issue Aug 17, 2018 · 5 comments

Comments

@kurnev
Copy link

kurnev commented Aug 17, 2018

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report 
[x] Feature request
[ ] Documentation issue or request

Current behavior

If I open viewer.js in modal padding-right is always added to the body.

It is done here: https://github.com/fengyuanchen/viewerjs/blob/master/src/js/others.js#L26

Expected behavior

I expect additional option to turn off/on this feature.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Currently is breaks layout in our project.

Environment


Viewer.js version: 1.2.0


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [x] Firefox version XX
- [x] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [x] IE version XX
- [x] Edge version XX

Others:

@JohnnyAW
Copy link

JohnnyAW commented Jan 3, 2020

same here, not even sure, why you need this additional padding...

@mathias22osterhagen22
Copy link

same here, it makes all my app litteraly jumping on the left (especially with vuejs app)

@mathias22osterhagen22
Copy link

I literally fixed it like this:

let viewer = new Viewer(document.querySelector("#image"), { navbar: false, } });
//here
viewer.close = function(){}
viewer.open = function(){}

Please put this ugly padding in a class that can be overridden.

@ahsath
Copy link

ahsath commented May 8, 2020

any news?

@mirari
Copy link
Contributor

mirari commented Jun 7, 2021

I also noticed the same problem with the body being added with a padding-right causing the style on the background to jitter when the viewer pops up.
In addition, if the user has modified the padding-right style of the body after loading the viewer, the value will be lost after popping up the viewer and closing it.
I suggest leaving this part up to the user to define, for example, setting the .viewer-open style.

我也注意到了同样问题,body被添加了一个padding-right导致弹出viewer时背景上的样式发生抖动。
另外,如果用户在加载viewer后又修改过body的padding-right样式,弹出viewer并关闭后设置值会丢失。
我建议这部分逻辑让用户自己定义就好,比如设置.viewer-open样式。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants