From 2987f7f705baffad8081fc4a3a95eab79b0d9695 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Thu, 22 Jul 2010 15:32:57 -0700 Subject: fix howers which were accidently broken --- example/buzz/buzz.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'example/buzz/buzz.js') diff --git a/example/buzz/buzz.js b/example/buzz/buzz.js index 871982d7..40813d16 100644 --- a/example/buzz/buzz.js +++ b/example/buzz/buzz.js @@ -15,5 +15,32 @@ BuzzController.prototype = { userChange: function(){ this.userId = this.$location.hashPath; this.activities = this.Activity.get({userId:this.userId}); + }, + + expandReplies: function(activity) { + var self = this; + if (activity.replies) { + activity.replies.show = !activity.replies.show; + } else { + activity.replies = this.Activity.replies({userId:this.userId, activityId:activity.id}, function(){ + activity.replies.show = true; + }); + } } }; + +angular.widget('my:expand', function(element){ + element.css('display', 'block'); + this.descend(true); + return function(element) { + element.hide(); + var watch = element.attr('expand'); + this.$watch(watch, function(value){ + if (value) { + element.delay(0).slideDown('slow'); + } else { + element.slideUp('slow'); + } + }); + }; +}); -- cgit v1.2.3