diff --git a/.all-contributorsrc b/.all-contributorsrc
index 19316328..67555488 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -293,6 +293,16 @@
"contributions": [
"doc"
]
+ },
+ {
+ "login": "chrisdrackett",
+ "name": "Chris Drackett",
+ "avatar_url": "https://avatars3.githubusercontent.com/u/4378?v=4",
+ "profile": "https://github.com/chrisdrackett",
+ "contributions": [
+ "code",
+ "design"
+ ]
}
],
"repoType": "github"
diff --git a/README.md b/README.md
index e6ec8226..9e26f645 100644
--- a/README.md
+++ b/README.md
@@ -100,7 +100,7 @@ Thanks goes to these people ([emoji key][emojis]):
| [
Leon Chen](https://transcranial.github.io)
[π»](https://github.com/prettier/prettier-atom/commits?author=transcranial "Code") | [
Christopher Chedeau](http://blog.vjeux.com/)
[π¬](#question-vjeux "Answering Questions") [π»](https://github.com/prettier/prettier-atom/commits?author=vjeux "Code") [π](#plugin-vjeux "Plugin/utility libraries") | [
Christoph Geschwind](http://christoph-geschwind.de)
[π»](https://github.com/prettier/prettier-atom/commits?author=1st8 "Code") | [
Andrew Hutchings](https://andrewhutchings.com)
[π»](https://github.com/prettier/prettier-atom/commits?author=ahutchings "Code") | [
David Schnurr](http://davidschnurr.com)
[π»](https://github.com/prettier/prettier-atom/commits?author=schnerd "Code") | [
Ryan Cole](http://rycole.com/)
[π»](https://github.com/prettier/prettier-atom/commits?author=ryancole "Code") | [
Dara Hak](https://github.com/darahak)
[π»](https://github.com/prettier/prettier-atom/commits?author=darahak "Code") [π](https://github.com/prettier/prettier-atom/commits?author=darahak "Documentation") |
| [
Stephen John Sorensen](http://www.stephenjohnsorensen.com/)
[π»](https://github.com/prettier/prettier-atom/commits?author=spudly "Code") | [
Lukas Geiger](https://github.com/lgeiger)
[π»](https://github.com/prettier/prettier-atom/commits?author=lgeiger "Code") [β οΈ](https://github.com/prettier/prettier-atom/commits?author=lgeiger "Tests") | [
Viktor Charypar](https://github.com/charypar)
[π»](https://github.com/prettier/prettier-atom/commits?author=charypar "Code") [β οΈ](https://github.com/prettier/prettier-atom/commits?author=charypar "Tests") | [
Mats HΓΆgberg](http://mats.hgbrg.se)
[π»](https://github.com/prettier/prettier-atom/commits?author=mhgbrg "Code") | [
Roman](https://github.com/RoM4iK)
[π»](https://github.com/prettier/prettier-atom/commits?author=RoM4iK "Code") | [
vaibhav](https://vaibhavchatarkar.com)
[π»](https://github.com/prettier/prettier-atom/commits?author=da-vaibhav "Code") | [
Karl Horky](https://work.karlhorky.com)
[π»](https://github.com/prettier/prettier-atom/commits?author=karlhorky "Code") |
| [
Dan Abramov](http://twitter.com/dan_abramov)
[π»](https://github.com/prettier/prettier-atom/commits?author=gaearon "Code") | [
Murphy Randle](https://sploding.rocks)
[π»](https://github.com/prettier/prettier-atom/commits?author=splodingsocks "Code") [π](https://github.com/prettier/prettier-atom/issues?q=author%3Asplodingsocks "Bug reports") | [
Matthieu Lemoine](https://matthieulemoine.com)
[π»](https://github.com/prettier/prettier-atom/commits?author=MatthieuLemoine "Code") | [
Ron Green](https://github.com/rgreenjr)
[π»](https://github.com/prettier/prettier-atom/commits?author=rgreenjr "Code") | [
Harold Treen](https://haroldtreen.com)
[π](https://github.com/prettier/prettier-atom/issues?q=author%3Aharoldtreen "Bug reports") [π»](https://github.com/prettier/prettier-atom/commits?author=haroldtreen "Code") | [
Nikita Mashukov](https://github.com/ferdibiflator)
[π»](https://github.com/prettier/prettier-atom/commits?author=ferdibiflator "Code") | [
Sam Horton](https://github.com/SavePointSam)
[π»](https://github.com/prettier/prettier-atom/commits?author=SavePointSam "Code") [β οΈ](https://github.com/prettier/prettier-atom/commits?author=SavePointSam "Tests") |
-| [
olsonpm](https://github.com/olsonpm)
[π»](https://github.com/prettier/prettier-atom/commits?author=olsonpm "Code") | [
David Singleton](http://dsingleton.co.uk)
[π](https://github.com/prettier/prettier-atom/commits?author=dsingleton "Documentation") |
+| [
olsonpm](https://github.com/olsonpm)
[π»](https://github.com/prettier/prettier-atom/commits?author=olsonpm "Code") | [
David Singleton](http://dsingleton.co.uk)
[π](https://github.com/prettier/prettier-atom/commits?author=dsingleton "Documentation") | [
Chris Drackett](https://github.com/chrisdrackett)
[π»](https://github.com/prettier/prettier-atom/commits?author=chrisdrackett "Code") [π¨](#design-chrisdrackett "Design") |
This project follows the [all-contributors][all-contributors] specification. Contributions of any kind are welcome!
diff --git a/dist/statusTile/updateStatusTile.js b/dist/statusTile/updateStatusTile.js
index 7c0153b2..f5d4948f 100644
--- a/dist/statusTile/updateStatusTile.js
+++ b/dist/statusTile/updateStatusTile.js
@@ -7,7 +7,15 @@ const { addTooltip } = require('../atomInterface');
const updateStatusTile = (disposable, element) => {
disposeTooltip();
- element.dataset.prettierFormatOnSave = getFormatOnSaveStatus(); // eslint-disable-line no-param-reassign
+ const formatStatus = getFormatOnSaveStatus();
+
+ if (formatStatus === 'enabled') {
+ element.classList.add('text-success');
+ } else {
+ element.classList.remove('text-success');
+ }
+
+ element.dataset.prettierFormatOnSave = formatStatus; // eslint-disable-line no-param-reassign
const newTooltip = addTooltip(element, {
title: `Format on Save: ${getFormatOnSaveStatus()}
Click to toggle`
diff --git a/src/statusTile/updateStatusTile.js b/src/statusTile/updateStatusTile.js
index b4fa9f52..defadb33 100644
--- a/src/statusTile/updateStatusTile.js
+++ b/src/statusTile/updateStatusTile.js
@@ -6,7 +6,15 @@ const { addTooltip } = require('../atomInterface');
const updateStatusTile = (disposable: Atom$Disposable, element: HTMLElement) => {
disposeTooltip();
- element.dataset.prettierFormatOnSave = getFormatOnSaveStatus(); // eslint-disable-line no-param-reassign
+ const formatStatus = getFormatOnSaveStatus();
+
+ if (formatStatus === 'enabled') {
+ element.classList.add('text-success');
+ } else {
+ element.classList.remove('text-success');
+ }
+
+ element.dataset.prettierFormatOnSave = formatStatus; // eslint-disable-line no-param-reassign
const newTooltip = addTooltip(element, {
title: `Format on Save: ${getFormatOnSaveStatus()}
Click to toggle`,
diff --git a/src/statusTile/updateStatusTile.test.js b/src/statusTile/updateStatusTile.test.js
index 8e09b267..f193e83b 100644
--- a/src/statusTile/updateStatusTile.test.js
+++ b/src/statusTile/updateStatusTile.test.js
@@ -6,7 +6,13 @@ const updateStatusTile = require('./updateStatusTile');
const getFormatOnSaveStatus = require('./getFormatOnSaveStatus');
const callUpdateStatusTile = () => {
- const div = { dataset: {} };
+ const div = {
+ dataset: {},
+ classList: {
+ add: jest.fn(),
+ remove: jest.fn(),
+ },
+ };
const disposable = { add: jest.fn() };
updateStatusTile(disposable, div);
diff --git a/styles/statusTile.less b/styles/statusTile.less
index c3cc890a..96bfc885 100644
--- a/styles/statusTile.less
+++ b/styles/statusTile.less
@@ -12,7 +12,7 @@ div {
// If Format on Save is enabled, make the label more visible.
&[data-prettier-format-on-save='enabled'] {
- color: @text-color-success;
+ // color is handled by adding or removing the text-success class when updating the status tile
&::after {
content: ' β';
}