Implicitly declared variables in JS are global by default.
Fixes LGTM warning: "Variable header is used like a local variable, but
is missing a declaration."
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Fixes LGTM warning: "Avoid automated semicolon insertion (93% of all
statements in the enclosing script have an explicit semicolon)."
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Move the timer from ConversationListStore to MainWindow, ensure that
both the list and the viewer get their dates updated, but only when
the main window is visible.
The ComposerPageState JS object assumed that if no signature was present
when first loaded, that none ever would be. This broke changing the
signature when the composer was opened for an account without one, and
the from account was changed to an account with a sig.
Instead of including the signature as part of the loaded body, always
include just a skeleton signature DIV and ensure the signature is loaded
dynamically after the body has been loaded. Update code and tests to
match this assumption, and add a unit test for updating the sig.
Fixes#309
This default instance was causing double the number of preferred height
events, which was likely creating a race for ConversationWebView. This
might (should?) fix plain text email with quotes sometimes showing up
with a vastly incorrect height.
To ensure that a PageState is constructed properly, make ClientWebView
abstract and use replace the one direct use of the class in the accounts
editor for the signature with a new subclass.
See #283
If the common ancestor of the quoted text is the plain-text-message DIV
itself, the isDescendant test fails and the style to preserve new lines
is not maintained. This adds a non-strict check to isDescendant and
enables that when checking the common ancestor node and a test case for
it.
Use uppercase since that is what the DOM for HTML defaults to, use
nodeName rather than tagName for cases when there the check is false and
ancestor is the document element, add unit tests.
Don't allow any preferred heigh updates to be sent until DOM has been
fully loaded and manupliated (in particular by ConversaionWebView) so
it is vaugely correct when first resized and takes a collapsed quote
heights into account.
Moving the loading placeholder from ConversationListBox to
ConversationEmail allows a more fine-grained indication of what is
happening - only show the loading indicator when the remote actually
needs to get hit, display the email's details and load the rest of the
conversation while waiting for the remote body load. Also lets us pass
errors loading the initial email locally all the way up to the
controller.
Remove the first/last child hacks from ConversationListBox since the
GTK+ fix for :first-class and :last-class landed in early 3.22.x
releases. Ensure the first expanded email is properly size-allocated
before loading others, that it remains unmoving in the list as other
rows are added, add a loading bar above it when there are more email to
load below it.