aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/javascripts/controls.js
diff options
context:
space:
mode:
authorThomas Fuchs <thomas@fesch.at>2005-10-29 11:48:53 +0000
committerThomas Fuchs <thomas@fesch.at>2005-10-29 11:48:53 +0000
commitd8f0a3f93ca80fa64435dde8100d0eae6110207c (patch)
tree1f4aeef81cbb4f91efab33d87c628af4cf467858 /actionpack/lib/action_view/helpers/javascripts/controls.js
parent0a6d6082539f68733f44117ee0c7828c89dd3cfb (diff)
downloadrails-d8f0a3f93ca80fa64435dde8100d0eae6110207c.tar.gz
rails-d8f0a3f93ca80fa64435dde8100d0eae6110207c.tar.bz2
rails-d8f0a3f93ca80fa64435dde8100d0eae6110207c.zip
Update script.aculo.us to V1.5_rc4
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2802 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.js23
1 files changed, 18 insertions, 5 deletions
diff --git a/actionpack/lib/action_view/helpers/javascripts/controls.js b/actionpack/lib/action_view/helpers/javascripts/controls.js
index a7436bcf17..6da588543b 100644
--- a/actionpack/lib/action_view/helpers/javascripts/controls.js
+++ b/actionpack/lib/action_view/helpers/javascripts/controls.js
@@ -184,7 +184,10 @@ Autocompleter.Base.prototype = {
this.show();
this.active = true;
}
- } else this.hide();
+ } else {
+ this.active = false;
+ this.hide();
+ }
},
markPrevious: function() {
@@ -425,6 +428,15 @@ Autocompleter.Local.prototype = Object.extend(new Autocompleter.Base(), {
//
// see documentation on http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor
+// Use this if you notice weird scrolling problems on some browsers,
+// the DOM might be a bit confused when this gets called so do this
+// waits 1 ms (with setTimeout) until it does the activation
+Field.scrollFreeActivate = function(field) {
+ setTimeout(function() {
+ Field.activate(field);
+ }, 1);
+}
+
Ajax.InPlaceEditor = Class.create();
Ajax.InPlaceEditor.defaultHighlightColor = "#FFFF99";
Ajax.InPlaceEditor.prototype = {
@@ -490,7 +502,7 @@ Ajax.InPlaceEditor.prototype = {
Event.observe(this.options.externalControl, 'mouseout', this.mouseoutListener);
}
},
- enterEditMode: function() {
+ enterEditMode: function(evt) {
if (this.saving) return;
if (this.editing) return;
this.editing = true;
@@ -501,11 +513,12 @@ Ajax.InPlaceEditor.prototype = {
Element.hide(this.element);
this.createForm();
this.element.parentNode.insertBefore(this.form, this.element);
- Field.focus(this.editField);
+ Field.scrollFreeActivate(this.editField);
// stop the event to avoid a page refresh in Safari
- if (arguments.length > 1) {
- Event.stop(arguments[0]);
+ if (evt) {
+ Event.stop(evt);
}
+ return false;
},
createForm: function() {
this.form = document.createElement("form");