feat - add scollable property to modal

Adds optional property scrollable to modal. Fixes issue #61
This commit is contained in:
Dale Cameron
2020-10-07 14:47:54 -05:00
parent 3e9b981821
commit 645413b3f5
3 changed files with 8 additions and 1 deletions
+4
View File
@@ -2845,6 +2845,10 @@ Optional suffix of modal window class. The value used is appended to the <code>m
(<i>Note: Since this is directly injected into the class for the modal, you can leverage additional Bootstrap modal classes, such as <code>modal-dialog-centered</code>.
Ex: <code>md modal-dialog-centered</code>.</i>)</p>
</li>
<li><p><code>scrollable</code>
<em>(Type: <code>boolean</code>, Default: <code>false</code>)</em> -
Indicates whether the dialog will allow its content to scroll. If set to true, this will add the class 'modal-dialog-scrollable' to the rendered modal. </p>
</li>
<li><p><code>template</code>
<em>(Type: <code>string</code>)</em> -
Inline template representing the modal&#39;s content.</p>
+3
View File
@@ -102,6 +102,7 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.multiMap', 'ui.bootstrap.sta
link: function(scope, element, attrs) {
element.addClass(attrs.windowTopClass || '');
scope.size = attrs.size;
scope.scrollable = attrs.scrollable;
scope.close = function(evt) {
var modal = $modalStack.getTop();
@@ -484,6 +485,7 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.multiMap', 'ui.bootstrap.sta
'aria-labelledby': modal.ariaLabelledBy,
'aria-describedby': modal.ariaDescribedBy,
'size': modal.size,
'scrollable': modal.scrollable,
'index': topModalIndex,
'animate': 'animate',
'ng-style': '{\'z-index\': 1050 + $$topModalIndex*10, display: \'block\'}',
@@ -763,6 +765,7 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.multiMap', 'ui.bootstrap.sta
ariaLabelledBy: modalOptions.ariaLabelledBy,
ariaDescribedBy: modalOptions.ariaDescribedBy,
size: modalOptions.size,
scrollable: modalOptions.scrollable,
openedClass: modalOptions.openedClass,
appendTo: modalOptions.appendTo
};
+1 -1
View File
@@ -1 +1 @@
<div class="modal-dialog {{size ? 'modal-' + size : ''}}"><div class="modal-content" uib-modal-transclude></div></div>
<div class="modal-dialog {{size ? 'modal-' + size : ''}} {{scrollable ? 'modal-dialog-scrollable': ''}}"><div class="modal-content" uib-modal-transclude></div></div>