webui: adjust header controls alignment

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
Petr Vobornik 2014-05-13 12:38:38 +02:00
parent 99ed015c0a
commit 5c3fd4bb83
5 changed files with 72 additions and 64 deletions

View File

@ -166,25 +166,25 @@ div[name=settings].facet-group li a {
clear: both;
}
.right-aligned-facet-controls {
.facet-controls-left {
float: left;
}
.facet-controls-right {
float: right;
}
.control-buttons {
float: left;
display: inline-block;
}
.control-buttons a {
float: left;
font-size: 13px;
margin-right: 16px;
text-decoration: none;
}
.facet-actions {
display: inline-block;
float: right;
margin-right: 8px;
}
/* --- Facet error --- */

View File

@ -1041,57 +1041,58 @@ exp.association_facet = IPA.association_facet = function (spec, no_init) {
that.facet_create_header(container);
if (that.indirect_attribute_member) {
var div = $('<div/>', {
'class': 'right-aligned-facet-controls'
}).appendTo(that.controls);
div.append(text.get('@i18n:association.show_results'));
div.append(' ');
var name = that.entity.name+'-'+that.attribute_member+'-'+that.other_entity.name+'-type-radio';
var direct_id = name + '-direct';
that.direct_radio = $('<input/>', {
id: direct_id,
type: 'radio',
name: name,
value: 'direct',
click: function() {
that.association_type = $(this).val();
that.refresh();
return true;
}
}).appendTo(div);
$('<label/>', {
text: text.get('@i18n:association.direct_membership'),
'for': direct_id
}).appendTo(div);
div.append(' ');
var indirect_id = name + '-indirect';
that.indirect_radio = $('<input/>', {
id: indirect_id,
type: 'radio',
name: name,
value: 'indirect',
click: function() {
that.association_type = $(this).val();
that.refresh();
return true;
}
}).appendTo(div);
$('<label/>', {
text: text.get('@i18n:association.indirect_membership'),
'for': indirect_id
}).appendTo(div);
that.create_membership_radios(that.controls_right);
}
that.create_control_buttons(that.controls);
that.create_control_buttons(that.controls_left);
};
that.create_membership_radios = function(container) {
var div = $('<div/>', { 'class': 'association-direction'}).appendTo(container);
div.append(text.get('@i18n:association.show_results'));
div.append(' ');
var name = that.entity.name+'-'+that.attribute_member+'-'+that.other_entity.name+'-type-radio';
var direct_id = name + '-direct';
that.direct_radio = $('<input/>', {
id: direct_id,
type: 'radio',
name: name,
value: 'direct',
click: function() {
that.association_type = $(this).val();
that.refresh();
return true;
}
}).appendTo(div);
$('<label/>', {
text: text.get('@i18n:association.direct_membership'),
'for': direct_id
}).appendTo(div);
div.append(' ');
var indirect_id = name + '-indirect';
that.indirect_radio = $('<input/>', {
id: indirect_id,
type: 'radio',
name: name,
value: 'indirect',
click: function() {
that.association_type = $(this).val();
that.refresh();
return true;
}
}).appendTo(div);
$('<label/>', {
text: text.get('@i18n:association.indirect_membership'),
'for': indirect_id
}).appendTo(div);
};
that.get_attribute_name = function() {

View File

@ -631,8 +631,8 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) {
*/
that.create_controls = function() {
that.create_control_buttons(that.controls);
that.create_action_dropdown(that.controls);
that.create_control_buttons(that.controls_left);
that.create_action_dropdown(that.controls_left);
};
/**

View File

@ -593,6 +593,14 @@ exp.facet = IPA.facet = function(spec, no_init) {
that.controls = $('<div/>', {
'class': 'facet-controls clearfix'
}).appendTo(container);
that.controls_left = $('<div/>', {
'class': 'facet-controls-left'
}).appendTo(that.controls);
that.controls_right = $('<div/>', {
'class': 'facet-controls-right'
}).appendTo(that.controls);
};
/**

View File

@ -104,14 +104,16 @@ IPA.search_facet = function(spec, no_init) {
that.create_header = function(container) {
that.facet_create_header(container);
that.create_search_filter(that.controls_left);
that.create_control_buttons(that.controls_right);
that.create_action_dropdown(that.controls_right);
};
var div = $('<div/>', {
'class': 'right-aligned-facet-controls'
}).appendTo(that.controls);
that.create_search_filter = function(container) {
that.filter_container = $('<div/>', {
'class': 'search-filter'
}).appendTo(div);
}).appendTo(container);
that.filter = $('<input/>', {
type: 'text',
@ -134,9 +136,6 @@ IPA.search_facet = function(spec, no_init) {
return false;
}
}).appendTo(that.filter_container);
that.create_control_buttons(that.controls);
that.create_action_dropdown(that.controls);
};
that.managed_entity_pkey_prefix = function() {