Fix misc attachment styling / changed Chrome APIs

This commit is contained in:
Ben Gotow 2017-09-07 15:36:13 -07:00
parent f0401a7ba1
commit 40e932074a
5 changed files with 6 additions and 6 deletions

View file

@ -459,7 +459,7 @@ export default class ComposerView extends React.Component {
// Ensure that you can't pick up a file and drop it on the same draft // Ensure that you can't pick up a file and drop it on the same draft
const nonNativeFilePath = this._nonNativeFilePathForDrop(event); const nonNativeFilePath = this._nonNativeFilePathForDrop(event);
const hasNativeFile = event.dataTransfer.files.length > 0; const hasNativeFile = event.dataTransfer.types.includes('Files');
const hasNonNativeFilePath = nonNativeFilePath !== null; const hasNonNativeFilePath = nonNativeFilePath !== null;
return hasNativeFile || hasNonNativeFilePath; return hasNativeFile || hasNonNativeFilePath;

View file

@ -450,7 +450,7 @@ describe "ComposerView", ->
event = event =
dataTransfer: dataTransfer:
files:[{'pretend':'imafile'}] files:[{'pretend':'imafile'}]
types:[] types:['Files']
expect(@composer._shouldAcceptDrop(event)).toBe(true) expect(@composer._shouldAcceptDrop(event)).toBe(true)
it "should return true if the event is carrying a non-native file URL", -> it "should return true if the event is carrying a non-native file URL", ->

View file

@ -75,7 +75,7 @@ body.platform-win32 {
.nylas-attachment-item.image-attachment-item { .nylas-attachment-item.image-attachment-item {
margin: 0; margin: 0;
max-width: 100%; max-width: calc(100% - 22px); // right margin of composer
min-width: 0; min-width: 0;
} }
} }

View file

@ -43,7 +43,7 @@ export default class ConfigPersistenceManager {
_showLoadErrorDialog(error) { _showLoadErrorDialog(error) {
const message = `Failed to load "${path.basename(this.configFilePath)}"`; const message = `Failed to load "${path.basename(this.configFilePath)}"`;
let detail = (error.location) ? error.stack : error.message; let detail = error.message;
if (error instanceof SyntaxError) { if (error instanceof SyntaxError) {
detail += `\n\nThe file ${this.configFilePath} has incorrect JSON formatting or is empty. Fix the formatting to resolve this error, or reset your settings to continue using N1.` detail += `\n\nThe file ${this.configFilePath} has incorrect JSON formatting or is empty. Fix the formatting to resolve this error, or reset your settings to continue using N1.`

View file

@ -214,8 +214,8 @@ body.platform-win32 {
.file-action-icon { .file-action-icon {
position: absolute; position: absolute;
z-index: 2; z-index: 2;
right: -8px; right: 2px;
top: -8px; top: -14px;
width: 26px; width: 26px;
border-radius: 0 0 0 3px; border-radius: 0 0 0 3px;
border: none; border: none;