From faf4fea30fd01ad5f5c372877d0e8fe20963dc91 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Wed, 16 Apr 2014 12:04:59 +0200 Subject: [PATCH] webui: patternFly dialog Reviewed-By: Endi Sukma Dewata --- install/ui/less/dialog.less | 104 ------------------------------- install/ui/less/ipa.less | 1 - install/ui/src/freeipa/dialog.js | 72 +++++++++++++-------- install/ui/test/all_tests.html | 1 + install/ui/test/ipa_tests.html | 1 + install/ui/test/ipa_tests.js | 21 ++++--- ipatests/test_webui/ui_driver.py | 11 ++-- 7 files changed, 68 insertions(+), 143 deletions(-) delete mode 100644 install/ui/less/dialog.less diff --git a/install/ui/less/dialog.less b/install/ui/less/dialog.less deleted file mode 100644 index fda2b0a2b..000000000 --- a/install/ui/less/dialog.less +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Authors: - * UXD team - * Petr Vobornik - * - * Copyright (C) 2013 Red Hat - * see file 'COPYING' for use and warranty information - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -.rcue-dialog-background { - z-index: 1049; - background-color: rgba(0,0,0, 0.39); - width: 100%; - height: 100%; - position: fixed; - top: 0; - left: 0; - overflow: auto; - - .rcue-dialog-container { - padding: 30px; - } - - .rcue-dialog { - position: relative; - padding: 16px 22px; - max-width: 600px; - border: 1px solid #6e6d6d; - box-shadow: rgba(0,0,0, 0.39) 0 0 2px; - background-color: #fff; - margin: auto; - - header { - margin-bottom: 48px; - - h1 { - float: left; - margin: 0; - text-transform: none; - } - - a { - float: right; - } - - .rcue-button-close { - - position: absolute; - top: 15px; - right: 19px; - display: inline-block; - - .fa; - - &:before { - content: @fa-var-times; - } - - &:hover { - text-decoration: none; - } - } - } - - .rcue-dialog-body { - position: relative; - top: 0; - bottom: 60px; - clear: both; - } - - footer { - clear: both; - padding-left: 22px; - min-height: 25px; - - button { - float: right; - margin: 0px 5px 5px; - } - - .clear { - clear: both; - } - } - - code { - white-space: normal; - } - } -} diff --git a/install/ui/less/ipa.less b/install/ui/less/ipa.less index e87c15885..57c249fb7 100644 --- a/install/ui/less/ipa.less +++ b/install/ui/less/ipa.less @@ -6,7 +6,6 @@ @import "variables"; @import "mixins"; -@import "dialog"; @import "brand"; @import "forms-override"; @import "alerts"; diff --git a/install/ui/src/freeipa/dialog.js b/install/ui/src/freeipa/dialog.js index 228bc218d..dc6eb41c9 100644 --- a/install/ui/src/freeipa/dialog.js +++ b/install/ui/src/freeipa/dialog.js @@ -243,37 +243,39 @@ IPA.dialog = function(spec) { } that.dom_node = $('
', { - 'class': 'rcue-dialog-background', - keydown: that.on_key_down + 'class': 'modal fade', + keydown: that.on_key_down, + tabindex: '-1', + 'role': 'dialog', + 'aria-labelledby': 'myLargeModalLabel', + 'aria-hidden': 'true' }); - var container_node = $('
', { - 'class': 'rcue-dialog-container' - }).appendTo(that.dom_node); - that.dialog_node = $('
', { - 'class': 'rcue-dialog row', + 'class': 'modal-dialog', id: that.get_id(), 'data-name' : that.name, role: 'dialog', tabIndex: -1 // make the div focusable - }).appendTo(container_node); + }).appendTo(that.dom_node); - that.header_node = $('
'); + that.content_node = $('
', { 'class': 'modal-content' }). + appendTo(that.dialog_node); + that.header_node = $('
', { 'class': 'modal-header' }); that.create_header(); - that.header_node.appendTo(that.dialog_node); + that.header_node.appendTo(that.content_node); that.body_node = $('
', { - 'class': 'rcue-dialog-body row' + 'class': 'modal-body' }); // for backwards compatibility that.container = that.body_node; that.create_content(); - that.body_node.appendTo(that.dialog_node); + that.body_node.appendTo(that.content_node); - that.footer_node = $('