From e838df2bf41fedf55b4ed9c132d0b59b6ec0d5e1 Mon Sep 17 00:00:00 2001 From: Julien Dramaix Date: Wed, 13 Apr 2011 12:35:51 +0000 Subject: add fadeToggle() shortcut method in GQuery class --- .../src/main/java/com/google/gwt/query/client/GQuery.java | 11 +++++++++++ .../src/main/java/com/google/gwt/query/client/LazyGQuery.java | 8 ++++++++ 2 files changed, 19 insertions(+) (limited to 'gwtquery-core/src') diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java index e946c434..76472098 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java @@ -1741,6 +1741,17 @@ public class GQuery implements Lazy { return as(Effects).fadeOut(millisecs, f); } + /** + * Toggle the visibility of all matched elements by adjusting their opacity and + * firing an optional callback after completion. Only the opacity is adjusted for + * this animation, meaning that all of the matched elements should already + * have some form of height and width associated with them. + */ + public Effects fadeToggle(int millisecs, Function... f) { + return as(Effects).fadeToggle(millisecs, f); + } + + /** * Removes all elements from the set of matched elements that do not match the * specified function. The function is called with a context equal to the diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java index a499cff9..db127353 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java @@ -925,6 +925,14 @@ public interface LazyGQuery extends LazyBase{ */ LazyGQuery fadeOut(int millisecs, Function... f); + /** + * Toggle the visibility of all matched elements by adjusting their opacity and + * firing an optional callback after completion. Only the opacity is adjusted for + * this animation, meaning that all of the matched elements should already + * have some form of height and width associated with them. + */ + Effects fadeToggle(int millisecs, Function... f); + /** * Removes all elements from the set of matched elements that do not match the * specified function. The function is called with a context equal to the -- cgit v1.2.3