Browse Source

Adds image alignment options to modal, adds autofocus port from 0.x.x #836

pull/1129/head
jlukic 10 years ago
parent
commit
68cad017dc
2 changed files with 22 additions and 0 deletions
  1. 12
      src/definitions/modules/modal.js
  2. 10
      src/definitions/modules/modal.less

12
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,

10
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;

Loading…
Cancel
Save