This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/views/flag.js.es6
2014-07-04 11:50:40 -04:00

20 lines
595 B
JavaScript

export default Discourse.ModalBodyView.extend({
templateName: 'modal/flag',
title: function() {
return this.get('controller.flagTopic') ? I18n.t('flagging_topic.title') : I18n.t('flagging.title');
}.property('controller.flagTopic'),
selectedChanged: function() {
var self = this;
Em.run.next(function() {
self.$("input[type='radio']").prop('checked', false);
var nameKey = self.get('controller.selected.name_key');
if (!nameKey) return;
self.$('#radio_' + nameKey).prop('checked', 'true');
});
}.observes('controller.selected.name_key')
});