discourse/app/assets/javascripts/discourse/views/flag.js.es6

28 lines
839 B
Text
Raw Normal View History

import ModalBodyView from "discourse/views/modal-body";
export default ModalBodyView.extend({
2014-07-04 11:50:40 -04:00
templateName: 'modal/flag',
title: function() {
return this.get('controller.flagTopic') ? I18n.t('flagging_topic.title') : I18n.t('flagging.title');
}.property('controller.flagTopic'),
2015-05-06 11:57:27 -04:00
_selectRadio: function() {
this.$("input[type='radio']").prop('checked', false);
const nameKey = this.get('controller.selected.name_key');
if (!nameKey) { return; }
2015-05-06 11:57:27 -04:00
this.$('#radio_' + nameKey).prop('checked', 'true');
},
selectedChanged: function() {
Ember.run.next(this, this._selectRadio);
}.observes('controller.selected.name_key'),
2014-07-04 11:50:40 -04:00
2015-05-06 11:57:27 -04:00
// See: https://github.com/emberjs/ember.js/issues/10869
_selectedHack: function() {
this.removeObserver('controller.selected.name_key');
}.on('willDestroyElement')
2014-07-04 11:50:40 -04:00
});