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/components/composer-toggles.js.es6
Joe 2acb885c72 FEATURE: fullscreen composer mode on desktop
Adds keyboard shortcut and icon that allows expanding composer to full screen.
2018-10-15 13:59:49 +11:00

32 lines
789 B
JavaScript

import computed from "ember-addons/ember-computed-decorators";
export default Ember.Component.extend({
tagName: "",
@computed("composeState")
toggleTitle(composeState) {
return composeState === "draft" || composeState === "saving"
? "composer.abandon"
: "composer.collapse";
},
@computed("composeState")
fullscreenTitle(composeState) {
return composeState === "fullscreen"
? "composer.exit_fullscreen"
: "composer.enter_fullscreen";
},
@computed("composeState")
toggleIcon(composeState) {
return composeState === "draft" || composeState === "saving"
? "times"
: "chevron-down";
},
@computed("composeState")
fullscreenIcon(composeState) {
return composeState === "fullscreen" ? "compress" : "expand";
}
});