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

saving initial sizes break percentage widths/heights #4

Closed
fiatjaf opened this issue May 2, 2016 · 3 comments
Closed

saving initial sizes break percentage widths/heights #4

fiatjaf opened this issue May 2, 2016 · 3 comments

Comments

@fiatjaf
Copy link

fiatjaf commented May 2, 2016

I imagine that the following code:

        //save initial size
        self.initSize = [el.offsetWidth - self.b.left - self.b.right - self.p.left - self.p.right, el.offsetHeight - self.b.top - self.b.bottom - self.p.top - self.p.bottom];

        //save initial full size
        self.initSizeFull = [
            el.offsetWidth,
            el.offsetHeight
        ];

Is the code that is causing me problems. In my case, I want the element to be resizable horizontally, and it has a height: 100%. But after these initial sizes are saved, they're applied absolutely after resize, so if the screen changes the element will not have a height of 100% anymore, but an absolute height equal to the height it has as of the first drag.

Does that make sense?

Maybe instead of saving always the full size, the draggable could save only height or only width, according to the kind of resizing being performed.

@fiatjaf
Copy link
Author

fiatjaf commented May 2, 2016

Anyway, this can also be solved by an height: 100% !important CSS rule, and that's what I'm doing, so maybe the best idea here is just to add this solution to the documentation instead of implementing complicated and custom stuff.

@dy
Copy link
Owner

dy commented May 2, 2016

Definitely makes sense. Ill try to look at it today

@dy
Copy link
Owner

dy commented May 4, 2016

Fixed in @1.1.2. Thanks for the report.

@dy dy closed this as completed May 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants