aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-02-12 20:21:01 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-02-12 20:21:01 +0000
commit022a8fc6815e7f091c411fe9e716e2b7cfdcf22b (patch)
tree899e15b969a42439c2eef146c149365c016ad070 /actionpack
parent8dc4f4623354b65a639ac3c8981e1c362801d722 (diff)
downloadrails-022a8fc6815e7f091c411fe9e716e2b7cfdcf22b.tar.gz
rails-022a8fc6815e7f091c411fe9e716e2b7cfdcf22b.tar.bz2
rails-022a8fc6815e7f091c411fe9e716e2b7cfdcf22b.zip
Wups, committed too much
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3589 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/javascripts/prototype.js30
1 files changed, 16 insertions, 14 deletions
diff --git a/actionpack/lib/action_view/helpers/javascripts/prototype.js b/actionpack/lib/action_view/helpers/javascripts/prototype.js
index 62ee54efc1..2c201fd64c 100644
--- a/actionpack/lib/action_view/helpers/javascripts/prototype.js
+++ b/actionpack/lib/action_view/helpers/javascripts/prototype.js
@@ -436,8 +436,7 @@ var Enumerable = {
var collections = [this].concat(args).map($A);
return this.map(function(value, index) {
- iterator(value = collections.pluck(index));
- return value;
+ return iterator(collections.pluck(index));
});
},
@@ -943,6 +942,19 @@ Object.extend(Element, {
setTimeout(function() {html.evalScripts()}, 10);
},
+ replace: function(element, html) {
+ element = $(element);
+ if (element.outerHTML) {
+ element.outerHTML = html.stripScripts();
+ } else {
+ var range = element.ownerDocument.createRange();
+ range.selectNodeContents(element);
+ element.parentNode.replaceChild(
+ range.createContextualFragment(html.stripScripts()), element);
+ }
+ setTimeout(function() {html.evalScripts()}, 10);
+ },
+
getHeight: function(element) {
element = $(element);
return element.offsetHeight;
@@ -1305,18 +1317,8 @@ var Field = {
$(arguments[i]).value = '';
},
- // Pass the field id or element as the first parameter and optionally a triggering delay in micro-seconds as the second.
- // The delay is useful when the focus is part of effects that won't finish instantly since they prevent the focus from
- // taking hold. Set the delay to right after the effect finishes and the focus will work.
- focus: function() {
- element = $(arguments[0]);
- delay = arguments[1];
-
- if (delay) {
- setTimeout(function() { $(element).focus(); }, delay)
- } else {
- $(element).focus();
- }
+ focus: function(element) {
+ $(element).focus();
},
present: function() {