aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/javascripts/dragdrop.js3
-rw-r--r--actionpack/lib/action_view/helpers/javascripts/effects.js9
2 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/javascripts/dragdrop.js b/actionpack/lib/action_view/helpers/javascripts/dragdrop.js
index b44afe4881..2b68ee30e4 100644
--- a/actionpack/lib/action_view/helpers/javascripts/dragdrop.js
+++ b/actionpack/lib/action_view/helpers/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/actionpack/lib/action_view/helpers/javascripts/effects.js b/actionpack/lib/action_view/helpers/javascripts/effects.js
index c5183092fd..3abb0eed04 100644
--- a/actionpack/lib/action_view/helpers/javascripts/effects.js
+++ b/actionpack/lib/action_view/helpers/javascripts/effects.js
@@ -918,3 +918,12 @@ Effect.Fold = function(element) {
}} });
}}, arguments[1] || {}));
}
+
+if(Element.Methods) {
+ Element.Methods.visualEffect = function(element, effect, options) {
+ s = effect.gsub(/_/, '-').camelize();
+ effect_class = s.charAt(0).toUpperCase() + s.substring(1);
+ new Effect[effect_class](element, options);
+ return $(element);
+ }
+}