likeastore/ngDialog — pull request #48 by robbaman (2014-07-13 22:57:26+00:00)
Title: Prevent the document from jumping if a dialog is shown while the body has a scrollbar

This change determines if the width of the document compared to the width of the window changes after applying the 'overflow: hidden' class. If so, the document must've had a scrollbar and a padding-right is applied to the body equal to the size of the width difference.

This prevents the content of the document from jumping slightly because of the changed body width (this effect is most noticably when the content is centered, which is not the case on the example page unfortunately).

Note that if a padding-right is already present on the body, the scrollbar padding is added when the dialog is shown and restored to the original value when the dialog is closed.