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

Window constrain doesn't handle auto height #897

Open
johnstacy opened this issue Mar 2, 2020 · 1 comment
Open

Window constrain doesn't handle auto height #897

johnstacy opened this issue Mar 2, 2020 · 1 comment

Comments

@johnstacy
Copy link
Collaborator

johnstacy commented Mar 2, 2020

I'm passing a really large x and y value os.ui.window.launch() to try to launch a window in the lower right corner for a window with height: auto. When the following code runs, it doesn't work as expected because the height of the window hasn't been calculated yet so h is only 38px. Not sure if there is a good way around this...

  if (y < winContainerTop) {
    this.element.css('top', winContainerTop + 'px');
  } else if ((y + h) > size.height) {
    y = Math.max(size.height - h, winContainerTop);
    this.element.css('top', y + 'px');
  }
@gregroyal
Copy link
Collaborator

gregroyal commented Aug 21, 2020

You should be able to wait until you think your window is sized, then fire the $scope.$emit(os.ui.WindowEventType.READY) from your directive thats inside the window

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