Mailspring/internal_packages/attachments/stylesheets/attachments.less
Evan Morikawa e8d24ea1b5 refactor(DB): promisify database
Summary:
WIP. The app launches and works for me. I still need to fix the tests
just the DB ones though :D

I changed the `DatabaseProxy` into a `DatabaseConnection` object. It will
request a fully instantiated databse from the backend Browser.

If we're already setup, it'll connect straight to the existing DB.

If we're not setup, then it'll create a new database and run the inital
schema migration on it. The `_createNewDatabase` promise won't resolve
until the migration has run.

Until we add in a more sophisticated migration system and get rid of the
stupid `modelClassMap` that's shoved in `Utils`, I'm passing in a series
of `_setupQueries()` to get everything started.

The `DatabaseConnection` is also the one responsible for queuing up
queries until the DB is fully populated and ready to go.

We actually get a lot of queries before we're setup because a lot of
Stores will make DB requests on `require` in their `constructor` or `init`
methods. (remember all the times we call `_populateStore` in `init`).

Now those queries are aggregated by the `DatabaseConnection` and then
executed sequentially.

Our methods like `persistModel` now resolve only after both the queries
have completed AND their corresponding `triggerLater` has completed as
well.

Test Plan: in progress

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1688
2015-06-26 07:42:41 -07:00

207 lines
4.1 KiB
Plaintext

@import "ui-variables";
@import "ui-mixins";
.attachment-file-wrap {
cursor: default;
display: inline-block;
position: relative;
font-size: @font-size-small;
margin: 0 @spacing-standard @spacing-standard @spacing-standard;
background: @background-off-primary;
box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.09);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: calc(~"50% - 23px");
border-radius: 4px;
&.non-image-attachment {
width: calc(~"50% - 23px");
margin-left: @spacing-standard;
}
&:nth-child(even) {
margin-left: 0;
}
&.file-upload {
border-radius: 4px;
padding: 13px @spacing-standard 13px @spacing-standard;
.attachment-file-name {
color: @text-color-very-subtle;
.uploading {
color: @text-color;
}
}
}
.attachment-inner-wrap {
border-radius: 4px;
padding: 13px @spacing-standard 13px @spacing-standard;
position: relative;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&:hover {
cursor: default;
}
&.pending, &.started, &.progress, &.downloading {
}
.attachment-file-icon {
margin-right: 7px;
}
.attachment-file-name {
font-weight: @font-weight-medium;
}
.attachment-file-and-name {
position: relative;
z-index: 2;
}
.attachment-file-actions {
position: relative;
z-index: 3;
.attachment-icon {
float: right;
position: relative;
top: 2px;
margin-left: 10px;
}
}
}
.image-file-upload,
.image-attachment-file-wrap,
.attachment-file-wrap,
.attachment-inner-wrap {
.attachment-download-bar-wrap {
display: none;
}
&.downloading, &.started, &.progress {
.attachment-download-bar-wrap {
display: block;
}
}
&.completed, &.success {
.attachment-download-bar-wrap {
display: block;
}
.attachment-upload-progress { background: @background-color-success; }
}
&.aborted, &.failed {
.attachment-download-bar-wrap {
display: block;
}
.attachment-upload-progress { background: @background-color-error; }
}
.attachment-download-progress,
.attachment-upload-progress {
position: absolute;
left: 0;
bottom: 0;
height: 2px;
width: 0; // Changed by React
z-index: 3;
display: block;
background: @progress-bar-fill;
}
.attachment-bar-bg {
position: absolute;
left: 0;
bottom: 0;
height: 2px;
width: 100%;
z-index: 2;
display: block;
background: @progress-bar-background;
}
}
.image-attachment-file-wrap,
.image-file-upload {
position: relative;
text-align: center;
display:inline-block;
vertical-align: top;
margin-bottom: @spacing-standard;
margin-right: @spacing-standard;
margin-left: @spacing-standard;
.attachment-download-progress,
.attachment-upload-progress {
bottom: -2px;
}
.attachment-bar-bg {
bottom: -2px;
}
.attachment-file-actions {
position: relative;
z-index: 2;
}
&:hover {
.attachment-file-actions, .attachment-name-container, .attachment-name {
display: block;
}
}
.attachment-file-actions, .attachment-name-container, .attachment-name {
display: none;
}
.attachment-icon {
position: absolute;
z-index: 2;
right: -8px;
top: -8px;
width: 26px;
border-radius: 0 0 0 3px;
}
.attachment-preview {
position: relative;
z-index: 1;
overflow: hidden;
.attachment-name-container {
position: absolute;
bottom: 0;
top: 0;
z-index: 2;
width: 100%;
height:100%;
min-height:300px;
background: linear-gradient(to top, rgba(0,0,0,0.75) 0%,rgba(0,0,0,0) 23%);
vertical-align:bottom;
.attachment-name {
color: @white;
left: @spacing-standard;
bottom: @spacing-standard;
position: absolute;
z-index: 3;
}
}
img {
position: relative;
z-index: 1;
max-width: 100%;
background: url(../static/images/attachments/transparency-background.png) top left repeat;
background-size:8px;
}
}
}