Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion sao/src/sao.js
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,8 @@ var Sao = {

Sao.Dialog = Sao.class_(Object, {
init: function(
title, class_, size='sm', keyboard=true, small=null) {
title, class_, size='sm', keyboard=true, small=null,
closeable=false) {
this.modal = jQuery('<div/>', {
'class': class_ + ' modal fade',
'role': 'dialog',
Expand All @@ -954,6 +955,17 @@ var Sao = {
this.header = jQuery('<div/>', {
'class': 'modal-header'
}).appendTo(this.content);
if (closeable) {
var close_button = jQuery('<button/>', {
'type': 'button',
'class': 'close',
'data-dismiss': 'modal',
'aria-label': Sao.i18n.gettext("Close"),
}).append(jQuery('<span>', {
'aria-hidden': true,
}).append('&times;'));
this.header.append(close_button);
}
if (title) {
this.add_title(title, small);
}
Expand Down
3 changes: 2 additions & 1 deletion sao/src/screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,8 @@
};
if (!this.search_modal) {
var dialog = new Sao.Dialog(
Sao.i18n.gettext('Filters'), '', 'lg');
Sao.i18n.gettext('Filters'), '', 'lg', true, null,
true);
this.search_modal = dialog.modal;
this.search_form = dialog.content;
this.search_form.addClass('form-horizontal');
Expand Down
4 changes: 4 additions & 0 deletions sao/src/theme/coog/sao.less
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,10 @@ div.modal-header {
.coog-group-header-colors();
}

div.modal-header .close {
font-size: 21px;
}

div.wizard-dialog {
// For "small" state views, bump the window width from 600px
> div.modal-dialog.modal-md {
Expand Down
14 changes: 14 additions & 0 deletions sao/src/wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,20 @@
this.screen.add_view(view);
this.screen.switch_view();
this.screen.windows.push(this);
var close_button = jQuery('<button/>', {
'type': 'button',
'class': 'close',
'aria-label': Sao.i18n.gettext("Close"),
}).append(jQuery('<span>', {
'aria-hidden': true,
}).append('&times;'));
close_button.click((e) => {
e.preventDefault();
if (this.end_state in this.states) {
this.response(this.states[this.end_state].attributes);
}
});
this.header.append(close_button);
this.header.append(jQuery('<h4/>', {
'class': 'model-title',
'title': this.name,
Expand Down