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/modal/flag_view.js
2013-05-31 12:29:38 -04:00

29 lines
796 B
JavaScript

/**
This view handles the modal for flagging posts
@class FlagView
@extends Discourse.ModalBodyView
@namespace Discourse
@module Discourse
**/
Discourse.FlagView = Discourse.ModalBodyView.extend({
templateName: 'modal/flag',
title: Em.String.i18n('flagging.title'),
selectedChanged: function() {
var nameKey = this.get('controller.selected.name_key');
if (!nameKey) return;
Em.run.next(function() {
$('#radio_' + nameKey).prop('checked', 'true');
});
}.observes('controller.selected.name_key'),
didInsertElement: function() {
this._super();
// Would be nice if there were an EmberJs radio button to do this for us. Oh well, one should be coming
// in an upcoming release.
this.$("input[type='radio']").prop('checked', false);
}
});