Commit bf9c6341 authored by webchick's avatar webchick

#550572 by sun and c960657: Fixed CSS+JS regressions related to form-item-[name].

parent 03a5563b
......@@ -2540,10 +2540,10 @@ function theme_form_element($element) {
// Add element's #type and #name as class to aid with JS/CSS selectors.
$class = array('form-item');
if (!empty($element['#type'])) {
$class[] = 'form-item-' . strtr($element['#type'], array('_' => '-'));
$class[] = 'form-type-' . strtr($element['#type'], '_', '-');
}
if (!empty($element['#name'])) {
$class[] = strtr($element['#name'], array(' ' => '-', '_' => '-', '[' => '-', ']' => '')) . '-wrapper';
$class[] = 'form-item-' . strtr($element['#name'], array(' ' => '-', '_' => '-', '[' => '-', ']' => ''));
}
$output = '<div class="' . implode(' ', $class) . '">' . "\n";
......
......@@ -38,7 +38,7 @@
html.js #edit-book-pick-book {
display: none;
}
.form-item-book-bid-wrapper .description {
.form-item-book-bid .description {
clear: both;
}
#book-admin-edit select {
......
/* $Id$ */
.form-item-type-wrapper, .form-item-severity-wrapper {
.form-item-type, .form-item-severity {
float: right;
padding-right: 0;
padding-left: .8em;
......
/* $Id$ */
.form-item-type-wrapper, .form-item-severity-wrapper {
.form-item-type, .form-item-severity {
float: left; /* LTR */
padding-right: .8em; /* LTR */
margin: 0.1em;
......
......@@ -5,7 +5,7 @@
text-decoration: line-through;
}
.form-item-language-wrapper, .form-item-translation-wrapper, .form-item-group-wrapper {
.form-item-language, .form-item-translation, .form-item-group {
float: left; /* LTR */
padding-right: .8em; /* LTR */
margin: 0.1em;
......
......@@ -6,11 +6,11 @@
background-repeat: no-repeat;
padding-left: 20px;
}
div.form-item-openid-identifier-wrapper {
div.form-item-openid-identifier {
display: block;
}
html.js #user-login-form div.form-item-openid-identifier-wrapper,
html.js #user-login div.form-item-openid-identifier-wrapper {
html.js #user-login-form div.form-item-openid-identifier,
html.js #user-login div.form-item-openid-identifier {
display: none;
}
html.js #user-login-form li.openid-link,
......
......@@ -3,8 +3,8 @@
Drupal.behaviors.openid = {
attach: function (context) {
var loginElements = $('.form-item-name-wrapper, .form-item-pass-wrapper, li.openid-link');
var openidElements = $('.form-item-openid-identifier-wrapper, li.user-link');
var loginElements = $('.form-item-name, .form-item-pass, li.openid-link');
var openidElements = $('.form-item-openid-identifier, li.user-link');
// This behavior attaches by ID, so is only valid once on a page.
if (!$('#edit-openid-identifier.openid-processed').size() && $('#edit-openid-identifier').val()) {
......
......@@ -66,11 +66,6 @@ html.js fieldset.collapsed legend a {
background-position: 98% 50%;
}
div.teaser-button-wrapper {
float: left;
padding-right: 0;
padding-left: 5%;
}
.teaser-checkbox div.form-item {
float: left;
margin: 0 0 0 5%;
......
......@@ -409,11 +409,6 @@ a.tabledrag-handle-hover .handle {
.teaser-checkbox {
padding-top: 1px;
}
div.teaser-button-wrapper {
float: right; /* LTR */
padding-right: 5%; /* LTR */
margin: 0;
}
.teaser-checkbox div.form-item {
float: right; /* LTR */
margin: 0 5% 0 0; /* LTR */
......
......@@ -8,15 +8,15 @@
Drupal.hideEmailAdministratorCheckbox = function () {
// Make sure the secondary box is shown / hidden as necessary on page load.
if ($('#edit-update-status-module-1').is(':checked')) {
$('.update-status-module-2-wrapper').show();
$('.form-item-update-status-module-2').show();
}
else {
$('.update-status-module-2-wrapper').hide();
$('.form-item-update-status-module-2').hide();
}
// Toggle the display as necessary when the checkbox is clicked.
$('#edit-update-status-module-1').change( function () {
$('.update-status-module-2-wrapper').toggle();
$('.form-item-update-status-module-2').toggle();
})
};
......@@ -196,7 +196,7 @@ Drupal.behaviors.machineReadableValue = {
// Build selector for the machine readable name.
var target = '#edit-' + settings.target;
// Build selector for the wrapper element around the target field.
var wrapper = '.' + settings.target + '-wrapper';
var wrapper = '.form-item-' + settings.target;
// Do not process the element if we got an error or the given name and the
// machine readable name are identical or the machine readable name is
......
......@@ -4,13 +4,13 @@
Drupal.behaviors.contentTypes = {
attach: function () {
if ($('#edit-machine-name').val() == $('#edit-name').val().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/_+/g, '_') || $('#edit-machine-name').val() == '') {
$('#edit-machine-name-wrapper').hide();
$('.form-item-machine-name').hide();
$('#edit-name').keyup(function () {
var machine = $(this).val().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/_+/g, '_');
if (machine != '_' && machine != '') {
$('#edit-machine-name').val(machine);
$('#vocabulary-name-suffix').empty().append(' Machine name: ' + machine + ' [').append($('<a href="#">' + Drupal.t('Edit') + '</a>').click(function () {
$('#edit-machine-name-wrapper').show();
$('.form-item-machine-name').show();
$('#vocabulary-name-suffix').hide();
$('#edit-name').unbind('keyup');
return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment