Commit becdc432 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#214292 by theborg: collapse.js alters the default submit buttons in forms in Internet Explorer

parent d04ebcee
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
*/ */
Drupal.toggleFieldset = function(fieldset) { Drupal.toggleFieldset = function(fieldset) {
if ($(fieldset).is('.collapsed')) { if ($(fieldset).is('.collapsed')) {
var content = $('> div', fieldset); // Action div containers are processed separately because of a IE bug
// that alters the default submit button behavior.
var content = $('> div:not(.action)', fieldset);
$(fieldset).removeClass('collapsed'); $(fieldset).removeClass('collapsed');
content.hide(); content.hide();
content.slideDown( { content.slideDown( {
...@@ -14,6 +16,7 @@ Drupal.toggleFieldset = function(fieldset) { ...@@ -14,6 +16,7 @@ Drupal.toggleFieldset = function(fieldset) {
complete: function() { complete: function() {
Drupal.collapseScrollIntoView(this.parentNode); Drupal.collapseScrollIntoView(this.parentNode);
this.parentNode.animating = false; this.parentNode.animating = false;
$('div.action', fieldset).show();
}, },
step: function() { step: function() {
// Scroll the fieldset into view // Scroll the fieldset into view
...@@ -22,7 +25,8 @@ Drupal.toggleFieldset = function(fieldset) { ...@@ -22,7 +25,8 @@ Drupal.toggleFieldset = function(fieldset) {
}); });
} }
else { else {
var content = $('> div', fieldset).slideUp('fast', function() { $('div.action', fieldset).hide();
var content = $('> div:not(.action)', fieldset).slideUp('fast', function() {
$(this.parentNode).addClass('collapsed'); $(this.parentNode).addClass('collapsed');
this.parentNode.animating = false; this.parentNode.animating = false;
}); });
...@@ -67,7 +71,7 @@ Drupal.behaviors.collapse = function (context) { ...@@ -67,7 +71,7 @@ Drupal.behaviors.collapse = function (context) {
return false; return false;
})) }))
.after($('<div class="fieldset-wrapper"></div>') .after($('<div class="fieldset-wrapper"></div>')
.append(fieldset.children(':not(legend)'))) .append(fieldset.children(':not(legend):not(.action)')))
.addClass('collapse-processed'); .addClass('collapse-processed');
}); });
}; };
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