Commit 73100428 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

IE6 fixes for feedback submission


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent a2204240
// The list of existing feedback.
function addFeedbackSuccess(form, data) {
addElementClass('add_feedback_form', 'js-hidden');
addElementClass('add_feedback_form', 'hidden');
paginator.updateResults(data);
$('add_feedback_form_message').value = '';
}
function objectionSuccess() {
addElementClass('objection_form', 'js-hidden');
addElementClass('objection_form', 'hidden');
$('objection_form_message').value = '';
}
addLoadEvent(function () {
if ($('add_feedback_form')) {
if ($('add_feedback_link')) {
var isIE6 = document.all && !window.opera &&
(!document.documentElement || typeof(document.documentElement.style.maxHeight) == "undefined");
connect('add_feedback_link', 'onclick', function(e) {
e.stop();
if ($('objection_form')) {
addElementClass('objection_form', 'js-hidden');
addElementClass('objection_form', 'hidden');
}
removeElementClass('add_feedback_form', 'js-hidden');
removeElementClass('add_feedback_form', 'hidden');
// IE6 fails to hide tinymce properly after feedback
// submission, so force it to reload the page by disconnecting
// the submit handler
if (isIE6) {
disconnectAll('add_feedback_form', 'onsubmit');
}
return false;
});
}
connect('cancel_add_feedback_form_submit', 'onclick', function (e) {
e.stop();
addElementClass('add_feedback_form', 'js-hidden');
addElementClass('add_feedback_form', 'hidden');
return false;
});
}
......@@ -35,15 +48,16 @@ addLoadEvent(function () {
connect('objection_link', 'onclick', function(e) {
e.stop();
if ($('add_feedback_form')) {
addElementClass('add_feedback_form', 'js-hidden');
addElementClass('add_feedback_form', 'hidden');
}
removeElementClass('objection_form', 'js-hidden');
removeElementClass('objection_form', 'js-safe-hidden');
removeElementClass('objection_form', 'hidden');
return false;
});
}
connect('cancel_objection_form_submit', 'onclick', function (e) {
e.stop();
addElementClass('objection_form', 'js-hidden');
addElementClass('objection_form', 'hidden');
return false;
});
}
......
......@@ -2982,7 +2982,7 @@ function objection_form() {
$form = array(
'name' => 'objection_form',
'method' => 'post',
'class' => 'js-hidden',
'class' => 'js-safe-hidden',
'plugintype' => 'core',
'pluginname' => 'view',
'jsform' => true,
......
......@@ -10,10 +10,21 @@
position: absolute;
visibility: hidden;
top: 0;
_position: relative;
*display: none;
*visibility: visible;
}
.js-safe-hidden {
position: absolute;
visibility: hidden;
top: 0;
*position: relative;
*height: 0;
*margin: 0;
*padding: 0;
}
/* These classes should be applied to things that should be shown with JS on -
they're hidden by the main stylesheet by default. Pick the one that suits
the display type required */
......
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