discourse/app/assets/javascripts/discourse/controllers/avatar_selector_controller.js
2013-10-08 18:58:24 +02:00

21 lines
694 B
JavaScript

/**
The modal for selecting an avatar
@class AvatarSelectorController
@extends Discourse.Controller
@namespace Discourse
@uses Discourse.ModalFunctionality
@module Discourse
**/
Discourse.AvatarSelectorController = Discourse.Controller.extend(Discourse.ModalFunctionality, {
actions: {
useUploadedAvatar: function() { this.set("use_uploaded_avatar", true); },
useGravatar: function() { this.set("use_uploaded_avatar", false); }
},
avatarTemplate: function() {
return this.get("use_uploaded_avatar") ? this.get("uploaded_avatar_template") : this.get("gravatar_template");
}.property("use_uploaded_avatar", "uploaded_avatar_template", "gravatar_template")
});