Skip to content

Instantly share code, notes, and snippets.

@xendk
Created January 15, 2013 08:59
Show Gist options
  • Save xendk/4537346 to your computer and use it in GitHub Desktop.
Save xendk/4537346 to your computer and use it in GitHub Desktop.
Reroll of http://drupal.org/files/fix-scroll.patch from http://drupal.org/node/1888190 , to apply to DRs patched Aloha.
diff --git a/js/drupal.aloha.js b/js/drupal.aloha.js
index b793142..beae428 100644
--- a/js/drupal.aloha.js
+++ b/js/drupal.aloha.js
@@ -137,6 +137,10 @@ Drupal.aloha = {
var id = $alohaEditable.attr('id');
var content = Aloha.getEditableById(id).getContents();
+ // Avoid scrolling on submit by ensuring that the textarea is the
+ // same height as the Aloha editor.
+ $editable.height($alohaEditable.height());
+
Aloha.jQuery('#' + id)
.unbind('aloha-smart-content-changed.aloha')
.mahalo();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment