Is it possible to trigger repositioning of a paper-action-dialog after dialog resize? When the dialog is resized, then the window is not centered anymore. Is there a way/function call to trigger repositioning of the dialog?
I've tried to set offsetLeft and offsetTop to zero but this won't trigger repositioning.
When the user resizes the browser window, the paper-action-dialog is immediately centered.
Yes, you can use the method called resizeHandler
Here is an example:
this.$.IdOfYourDialog.resizeHandler();
This is an inherited method from core-overlay.
Related
I've two Div's on my page. one is parent div, another div as pop-up.
Currently pop-up is shown/hide on click of parent div or clicking on button inside pop-up window.
How can I achieve that pop-up will be closed when I click away (anywhere outside pop-up and parent div) ? is there any event mechanism already provided ? if yes, How to use it?
You can create another div with full width and height and z-index bigger that other content and less than pop up. Show that div whenever the pop up is showed. Then you can add this div an click event so when the user click on that div it means that it's outside of pop up.
Here is an jsfiddle for that made with jquery just to give you the idea how to make it .
Here is another one with Angular DEMO
What I am trying to implement is a popup window with pure CSS, i.e. without using JavaScript. I have come up with a solution using the target pseudoclass, but the problem is that whenever I click the close button of the popup, it scrolls the viewport to the href element I specified, in this case #home. What I want to achieve is a functionality where the viewport doesn't move, regardless of the scroll position. For example, if I open the popup and then scroll to the last section, and then click the close button, the viewport should stay at the last section.
Here is jsFiddle: https://jsfiddle.net/tmzjpwkz/6/
replace href with #popup:target
Close
https://jsfiddle.net/tmzjpwkz/8/
As the size of the popup grows, the lower portion of the popup cannot be seen even if scrollbar is present. The scrollbar on the parent window should adjust automatically with the growing popup so that scrolling can be done to view the lower portion of the popup.
With out code its very difficult to say
make parent
overflow-y:scroll;
I have a script that shows a popup, and fairly often, the content is taller than the window and requires scrolling. The popup box is within a container div that has an overflow so the popup can be scrolled around without interfering with the scroll position on the rest of the page.
The issue is that when the popup box is displayed, when the up and down arrows are pressed, nothing happens as the popup box in the holder is not focused. Only when I click on an element within the container, then the arrows start working. Is it possible to perform a similar function to the 'click on an element' method described before, except in javascript. I tried .focus and other similar commands, but none worked.
Aha, sorted it. Set the holder's tabIndex to -1 and then .focus() worked on selecting it
I have a DIV that contains an activex control.
This control can resize itself depending on what buttons the user pokes.
When the control resizes itself, I would like to reposition the DIV.
How can I determine when the control or DIV size has changed without polling?
Can it be done?
Try putting an onresize event handler on the DIV.