ES6: Modals converted

This commit is contained in:
Robin Ward 2014-07-18 11:56:08 -04:00
parent c7330ed73f
commit a73b22b96f
7 changed files with 20 additions and 50 deletions

View file

@ -0,0 +1,5 @@
export default Ember.View.extend({
elementId: 'discourse-modal',
templateName: 'modal/modal',
classNameBindings: [':modal', ':hidden', 'controller.modalClass']
});

View file

@ -1,15 +0,0 @@
/**
A base class for helping us display modal content
@class ModalView
@extends Discourse.View
@namespace Discourse
@module Discourse
**/
Discourse.ModalView = Discourse.View.extend({
elementId: 'discourse-modal',
templateName: 'modal/modal',
classNameBindings: [':modal', ':hidden', 'controller.modalClass']
});

View file

@ -1,12 +0,0 @@
/**
A modal view for telling a user they're not activated
@class NotActivatedView
@extends Discourse.ModalBodyView
@namespace Discourse
@module Discourse
**/
Discourse.NotActivatedView = Discourse.ModalBodyView.extend({
templateName: 'modal/not_activated',
title: I18n.t('log_in')
});

View file

@ -1,23 +0,0 @@
/**
A modal view for displaying the options for a topic archetype
@class OptionBooleanView
@extends Discourse.View
@namespace Discourse
@module Discourse
**/
Discourse.OptionBooleanView = Discourse.GroupedView.extend({
classNames: ['archetype-option'],
composerControllerBinding: 'Discourse.router.composerController',
templateName: "modal/option_boolean",
checkedChanged: (function() {
var metaData;
metaData = this.get('parentView.metaData');
metaData.set(this.get('content.key'), this.get('checked') ? 'true' : 'false');
return this.get('controller.controllers.composer').saveDraft();
}).observes('checked')
});

View file

@ -0,0 +1,4 @@
export default Discourse.ModalBodyView.extend({
templateName: 'modal/not_activated',
title: I18n.t('log_in')
});

View file

@ -0,0 +1,11 @@
export default Discourse.GroupedView.extend({
classNames: ['archetype-option'],
composerControllerBinding: 'Discourse.router.composerController',
templateName: "modal/option_boolean",
_checkedChanged: function() {
var metaData = this.get('parentView.metaData');
metaData.set(this.get('content.key'), this.get('checked') ? 'true' : 'false');
this.get('controller.controllers.composer').saveDraft();
}.observes('checked')
});