diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index 173f78c4f..ac6f85f33 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -490,6 +490,16 @@ $.fn.modal = function(parameters) { .on('click' + eventNamespace, module.event.click) ; } + if(settings.autofocus) { + var + $inputs = $module.find(':input:visible'), + $autofocus = $inputs.filter('[autofocus]'), + $input = ($autofocus.size() > 0) + ? $autofocus + : $inputs + ; + $input.first().focus(); + } }, scrolling: function() { $dimmable.addClass(className.scrolling); @@ -714,6 +724,8 @@ $.fn.modal.settings = { allowMultiple : true, detachable : true, closable : true, + autofocus : true, + context : 'body', duration : 500, diff --git a/src/definitions/modules/modal.less b/src/definitions/modules/modal.less index 87c669e4c..6a123371c 100755 --- a/src/definitions/modules/modal.less +++ b/src/definitions/modules/modal.less @@ -112,11 +112,21 @@ padding: @contentPadding; background: @contentBackground; } + +/* Image */ .ui.modal > .content > .image { display: table-cell; width: @imageWidth; vertical-align: @imageVerticalAlign; } +.ui.modal > .content > .image[class*="top aligned"] { + vertical-align: top; +} +.ui.modal > .content > .image[class*="top aligned"] { + vertical-align: middle; +} + +/* Description */ .ui.modal > .content > .description { display: table-cell; vertical-align: top;