code: function checkDialogHeight()
          {
              var dialog = $element;
              var dialogHeader = dialog.find('.dialog__header');
              var dialogContent = dialog.find('.dialog__content');
              var dialogFooter = dialog.find('.dialog__footer');
  
              if (!dialogFooter.length)
              {
                  dialogFooter = dialog.find('.dialog__actions');
              }
  
              if (angular.isUndefined(dialogHeader))
              {
                  return;
              }
  
              var heightToCheck = 60 + dialogHeader.outerHeight() + dialogContent.outerHeight() + dialogFooter.outerHeight();
  
              if (dialogHeight === heightToCheck && windowHeight === $window.innerHeight)
              {
                  return;
              }
  
              dialogHeight = heightToCheck;
              windowHeight = $window.innerHeight;
  
              if (heightToCheck >= $window.innerHeight)
              {
                  dialog.addClass('dialog--is-fixed');
  
                  dialogScrollable
                      .css(
                      {
                          top: dialogHeader.outerHeight(),
                          bottom: dialogFooter.outerHeight()
                      })
                      .off('scroll', checkScrollEnd)
                      .on('scroll', checkScrollEnd);
              }
              else
              {
                  dialog.removeClass('dialog--is-fixed');
  
                  dialogScrollable
                      .removeAttr('style')
                      .off('scroll', checkScrollEnd);
              }
          }
docs: //////////