aboutsummaryrefslogtreecommitdiffstats
path: root/example/buzz/buzz.js
diff options
context:
space:
mode:
authorMisko Hevery2010-07-22 15:32:57 -0700
committerMisko Hevery2010-07-22 15:32:57 -0700
commit2987f7f705baffad8081fc4a3a95eab79b0d9695 (patch)
tree95cbcdb3e0dbf39d00b266075f551be8ddd87e9f /example/buzz/buzz.js
parent849a05b5a578f19ddc3d24dc9fbd304e0e07612a (diff)
downloadangular.js-2987f7f705baffad8081fc4a3a95eab79b0d9695.tar.bz2
fix howers which were accidently broken
Diffstat (limited to 'example/buzz/buzz.js')
-rw-r--r--example/buzz/buzz.js27
1 files changed, 27 insertions, 0 deletions
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');
+ }
+ });
+ };
+});