Permalink
Browse files

Added show() and hide() functions to jquery compat plugin, and tweake…

…d existing plugins to make them chainable.
  • Loading branch information...
filmaj committed Apr 5, 2011
1 parent 9480e64 commit e54b2814da2638059b2f6e0cc5f26570318c7d60
Showing with 17 additions and 5 deletions.
  1. +2 −2 fx-helpers/fx-helpers.js
  2. +1 −1 jquery-compat/README.md
  3. +14 −2 jquery-compat/jquery-compat.js
View
@@ -3,6 +3,6 @@ xui.extend({
var target = 0;
if (typeof to == 'string' && to == 'in') target = 1;
else if (typeof to == 'number') target = to;
- this.tween({opacity:target,duration:.2}, callback);
+ return this.tween({opacity:target,duration:.2}, callback);
}
-});
+});
View
@@ -1,3 +1,3 @@
jQuery Compatibility Plug-In for XUI
-------------
-Adds functions 'add()' and 'end()', for compatibility with jQuery (?).
+Adds functions `add`, `end`, `show` and `hide`, for compatibility with jQuery.
@@ -12,5 +12,17 @@ xui.extend({
*/
end: function () {
return this.set(this.cache || []);
- }
-});
+ },
+ /**
+ * Sets the `display` CSS property to `block`.
+ */
+ show:function() {
+ return this.setStyle('display','block');
+ },
+ /**
+ * Sets the `display` CSS property to `none`.
+ */
+ hide:function() {
+ return this.setStyle('display','none');
+ }
+});

0 comments on commit e54b281

Please sign in to comment.