diff options
author | Thomas Fuchs <thomas@fesch.at> | 2006-08-15 14:20:55 +0000 |
---|---|---|
committer | Thomas Fuchs <thomas@fesch.at> | 2006-08-15 14:20:55 +0000 |
commit | 6457b365a1a63018665dfbb4cb365d85be9dd771 (patch) | |
tree | 1519c151e01c4c17378e01b658410765308de3fb /actionpack/lib/action_view/helpers/javascripts/controls.js | |
parent | 5f3486c0b48081090c58940f5ed21a591c4cdf2f (diff) | |
download | rails-6457b365a1a63018665dfbb4cb365d85be9dd771.tar.gz rails-6457b365a1a63018665dfbb4cb365d85be9dd771.tar.bz2 rails-6457b365a1a63018665dfbb4cb365d85be9dd771.zip |
Updated trunk to script.aculo.us 1.6.2
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4766 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/helpers/javascripts/controls.js')
-rw-r--r-- | actionpack/lib/action_view/helpers/javascripts/controls.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/javascripts/controls.js b/actionpack/lib/action_view/helpers/javascripts/controls.js index de0261ed54..ea5ce6eacd 100644 --- a/actionpack/lib/action_view/helpers/javascripts/controls.js +++ b/actionpack/lib/action_view/helpers/javascripts/controls.js @@ -33,6 +33,9 @@ // useful when one of the tokens is \n (a newline), as it // allows smart autocompletion after linebreaks. +if(typeof Effect == 'undefined') + throw("controls.js requires including script.aculo.us' effects.js library"); + var Autocompleter = {} Autocompleter.Base = function() {}; Autocompleter.Base.prototype = { @@ -94,7 +97,7 @@ Autocompleter.Base.prototype = { }, fixIEOverlapping: function() { - Position.clone(this.update, this.iefix); + Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); this.iefix.style.zIndex = 1; this.update.style.zIndex = 2; Element.show(this.iefix); @@ -202,11 +205,13 @@ Autocompleter.Base.prototype = { markPrevious: function() { if(this.index > 0) this.index-- else this.index = this.entryCount-1; + this.getEntry(this.index).scrollIntoView(true); }, markNext: function() { if(this.index < this.entryCount-1) this.index++ else this.index = 0; + this.getEntry(this.index).scrollIntoView(false); }, getEntry: function(index) { @@ -531,7 +536,7 @@ Ajax.InPlaceEditor.prototype = { Element.hide(this.element); this.createForm(); this.element.parentNode.insertBefore(this.form, this.element); - Field.scrollFreeActivate(this.editField); + if (!this.options.loadTextURL) Field.scrollFreeActivate(this.editField); // stop the event to avoid a page refresh in Safari if (evt) { Event.stop(evt); @@ -636,6 +641,7 @@ Ajax.InPlaceEditor.prototype = { Element.removeClassName(this.form, this.options.loadingClassName); this.editField.disabled = false; this.editField.value = transport.responseText.stripTags(); + Field.scrollFreeActivate(this.editField); }, onclickCancel: function() { this.onComplete(); |