Skip to content

Commit aac8182

Browse files
committed
Merge pull request #546 from wmaurer/master
Hide fileStatus when compileOnSave is false
2 parents 9a76801 + e7babb5 commit aac8182

File tree

2 files changed

+34
-20
lines changed

2 files changed

+34
-20
lines changed

dist/main/atom/views/mainPanelView.js

+18-10
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,24 @@ var MainPanelView = (function (_super) {
175175
}
176176
};
177177
MainPanelView.prototype.updateFileStatus = function (filePath) {
178-
var status = fileStatusCache_1.getFileStatus(filePath);
179-
this.fileStatus.removeClass('icon-x icon-check text-error text-success');
180-
if (status.emitDiffers || status.modified) {
181-
this.fileStatus.text('Js emit is outdated');
182-
this.fileStatus.addClass('icon-x text-error');
183-
}
184-
else {
185-
this.fileStatus.text('Js emit up to date');
186-
this.fileStatus.addClass('icon-check text-success');
187-
}
178+
var _this = this;
179+
parent.getProjectFileDetails({ filePath: filePath }).then(function (fileDetails) {
180+
if (!fileDetails.project.compileOnSave) {
181+
_this.fileStatus.addClass("hidden");
182+
}
183+
else {
184+
var status_1 = fileStatusCache_1.getFileStatus(filePath);
185+
_this.fileStatus.removeClass('icon-x icon-check text-error text-success hidden');
186+
if (status_1.emitDiffers || status_1.modified) {
187+
_this.fileStatus.text('Js emit is outdated');
188+
_this.fileStatus.addClass('icon-x text-error');
189+
}
190+
else {
191+
_this.fileStatus.text('Js emit up to date');
192+
_this.fileStatus.addClass('icon-check text-success');
193+
}
194+
}
195+
});
188196
};
189197
MainPanelView.prototype.showPending = function () {
190198
atom.notifications.addInfo('Pending Requests: <br/> - ' + this.pendingRequests.join('<br/> - '));

lib/main/atom/views/mainPanelView.ts

+16-10
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import lineMessageView = require('./lineMessageView');
55
import atomUtils = require("../atomUtils");
66
import parent = require("../../../worker/parent");
77
import * as utils from "../../lang/utils";
8-
import {FileStatus,getFileStatus} from "../fileStatusCache";
8+
import { FileStatus, getFileStatus } from "../fileStatusCache";
99

1010
var panelHeaders = {
1111
error: 'Errors In Open Files',
@@ -205,15 +205,21 @@ export class MainPanelView extends view.View<any> {
205205

206206
///////////// Change JS File Status
207207
updateFileStatus(filePath: string) {
208-
let status = getFileStatus(filePath);
209-
this.fileStatus.removeClass('icon-x icon-check text-error text-success');
210-
if (status.emitDiffers || status.modified) {
211-
this.fileStatus.text('Js emit is outdated');
212-
this.fileStatus.addClass('icon-x text-error');
213-
} else {
214-
this.fileStatus.text('Js emit up to date');
215-
this.fileStatus.addClass('icon-check text-success');
216-
}
208+
parent.getProjectFileDetails({ filePath }).then(fileDetails => {
209+
if (!fileDetails.project.compileOnSave) {
210+
this.fileStatus.addClass("hidden");
211+
} else {
212+
let status = getFileStatus(filePath);
213+
this.fileStatus.removeClass('icon-x icon-check text-error text-success hidden');
214+
if (status.emitDiffers || status.modified) {
215+
this.fileStatus.text('Js emit is outdated');
216+
this.fileStatus.addClass('icon-x text-error');
217+
} else {
218+
this.fileStatus.text('Js emit up to date');
219+
this.fileStatus.addClass('icon-check text-success');
220+
}
221+
}
222+
});
217223
}
218224

219225
///////////// Pending Requests

0 commit comments

Comments
 (0)