aboutsummaryrefslogtreecommitdiffstats
path: root/railties/html/javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'railties/html/javascripts')
-rw-r--r--railties/html/javascripts/dragdrop.js3
-rw-r--r--railties/html/javascripts/effects.js9
2 files changed, 8 insertions, 4 deletions
diff --git a/railties/html/javascripts/dragdrop.js b/railties/html/javascripts/dragdrop.js
index b44afe4881..2b68ee30e4 100644
--- a/railties/html/javascripts/dragdrop.js
+++ b/railties/html/javascripts/dragdrop.js
@@ -558,9 +558,10 @@ var Sortable = {
findElements: function(element, options) {
if(!element.hasChildNodes()) return null;
var elements = [];
+ var only = options.only ? [options.only].flatten() : null;
$A(element.childNodes).each( function(e) {
if(e.tagName && e.tagName.toUpperCase()==options.tag.toUpperCase() &&
- (!options.only || (Element.hasClassName(e, options.only))))
+ (!only || (Element.classNames(e).detect(function(v) { return only.include(v) }))))
elements.push(e);
if(options.tree) {
var grandchildren = this.findElements(e, options);
diff --git a/railties/html/javascripts/effects.js b/railties/html/javascripts/effects.js
index 3abb0eed04..c1befe5397 100644
--- a/railties/html/javascripts/effects.js
+++ b/railties/html/javascripts/effects.js
@@ -86,9 +86,12 @@ Element.childrenWithClassName = function(element, className) {
}
Element.forceRerendering = function(element) {
- var n = document.createTextNode(' ');
- $(element).appendChild(n);
- Element.remove(n);
+ try {
+ element = $(element);
+ var n = document.createTextNode(' ');
+ element.appendChild(n);
+ element.removeChild(n);
+ } catch(e) {}
}
Array.prototype.call = function() {