From 21b709087c3a5efd870541ffeb476dcc556aec44 Mon Sep 17 00:00:00 2001
From: JohnAlbin <virtually.johnalbin@gmail.com>
Date: Thu, 7 Jul 2011 15:56:44 +0800
Subject: [PATCH] Issue #1211596 by JohnAlbin: Save/Preview buttons appear
 below node body during comment preview

---
 comment_notify-rtl.css |   17 ++++-------------
 comment_notify.css     |   17 ++---------------
 comment_notify.module  |   34 +++++++++++++++-------------------
 3 files changed, 21 insertions(+), 47 deletions(-)

diff --git a/comment_notify-rtl.css b/comment_notify-rtl.css
index 21a9f20..b4a4329 100644
--- a/comment_notify-rtl.css
+++ b/comment_notify-rtl.css
@@ -1,13 +1,4 @@
-#edit-notify-type-1-wrapper, #edit-notify-type-2-wrapper {
-  float: right;
-}
-
-#edit-notify-type-1-wrapper {
-  margin-left: 0em;
-  margin-right: 2em;
-}
-
-#edit-notify-type-2-wrapper {
-  margin-left: 0em;
-  margin-right: 1em;
-}
\ No newline at end of file
+#edit-notify-type .form-item-notify-type {
+  margin-left: 0;
+  margin-right: 1.5em;
+}
diff --git a/comment_notify.css b/comment_notify.css
index c2c8b1c..0195bf1 100644
--- a/comment_notify.css
+++ b/comment_notify.css
@@ -1,17 +1,4 @@
-#edit-notify-type-1-wrapper, #edit-notify-type-2-wrapper {
-  float: left;  /* LTR */
+#edit-notify-type .form-item-notify-type {
   display: inline;
-}
-
-#edit-notify-type-1-wrapper {
-  margin-left: 2em;  /* LTR */
-}
-
-#comment-notify .form-radios {
-  overflow: hidden;
-  height: 100%;
-}
-
-#edit-notify-type-2-wrapper {
-  margin-left: 1em;  /* LTR */
+  margin-left: 1.5em;
 }
diff --git a/comment_notify.module b/comment_notify.module
index 87f2cb7..82523ae 100644
--- a/comment_notify.module
+++ b/comment_notify.module
@@ -108,31 +108,27 @@ function comment_notify_form_comment_form_alter(&$form, &$form_state, $form_id)
 
   // If you want to hide this on your site see http://drupal.org/node/322482
   $form['notify_settings'] = array(
-      '#prefix' => '<div class="clear-block">',
-      '#suffix' => '</div>',
-      '#weight' => 0,
+    '#weight' => 0,
   );
 
   $form['notify_settings']['notify'] = array(
-      '#type' => 'checkbox',
-      '#title' => t('Notify me when new comments are posted'),
-      '#default_value' => (bool) $preference,
+    '#type' => 'checkbox',
+    '#title' => t('Notify me when new comments are posted'),
+    '#default_value' => (bool) $preference,
   );
 
-  if (count($available_options) > 1) {
-    $form['notify_settings']['notify_type'] = array(
-        '#type' => 'radios',
-        '#options' => $available_options,
-        '#default_value' => $preference,
-    );
-  }
-  else {
-    $form['notify_settings']['notify_type'] = array(
-        '#type' => 'hidden',
-        '#value' => key($available_options),
-    );
+  $form['notify_settings']['notify_type'] = array(
+    '#type' => 'radios',
+    '#options' => $available_options,
+    '#default_value' => $preference,
+  );
+  if (count($available_options) == 1) {
+    $form['notify_settings']['notify_type']['#type'] = 'hidden';
+    $form['notify_settings']['notify_type']['#value'] = key($available_options);
   }
-  $form['notify_settings']['notify_type']['#default_value'] = $preference;
+
+  // Otherwise, the submit buttons will jump below the node preview.
+  $form['actions']['#weight'] = 19;
 
   // If this is an existing comment we set the default value based on their selection last time.
   if ($form['cid']['#value'] != '') {
-- 
1.7.5.4

