Commit b081fa10 authored by MrMan's avatar MrMan

Hasty fixes of drastically incorrect logic

- layouts were done wrong
- loader was black not grey
parent 90d19226
......@@ -545,13 +545,13 @@ var LoadingIndicator = {
var title = vnode.attrs.title || "Loading...";
return m(".component.loading-indicator", [
m("img.icon.loading-icon", {src: "static/images/icons/loader.svg"}),
m("img.icon.loading-icon", {src: "static/images/icons/loader-gray.svg"}),
m(".title", title),
]);
},
};
var InboxRHS = {
var InboxMail = {
oninit: function() {
this.emailsLoaded = false;
......@@ -585,16 +585,7 @@ var InboxRHS = {
}
};
var InboxPage = {
view: function() {
return m(".component.app-page.inbox-page", [
m(LHSNav),
m(InboxRHS),
]);
}
};
var StarredRHS = {
var StarredMail = {
view: function(vnode) {
var newCount = vnode.attrs.newCount;
......@@ -611,16 +602,7 @@ var StarredRHS = {
}
};
var StarredPage = {
view: function() {
return m(".component.app-page.starred-page", [
m(LHSNav),
m(StarredRHS),
]);
}
};
var DraftRHS = {
var DraftMail = {
view: function(vnode) {
var newCount = vnode.attrs.newCount;
......@@ -637,16 +619,7 @@ var DraftRHS = {
}
};
var DraftPage = {
view: function() {
return m(".component.app-page.draft-page", [
m(LHSNav),
m(DraftRHS),
]);
}
};
var ImportantRHS = {
var ImportantMail = {
view: function(vnode) {
var newCount = vnode.attrs.newCount;
......@@ -663,38 +636,18 @@ var ImportantRHS = {
}
};
var ImportantPage = {
view: function() {
var MainLayout = {
view: function(vnode) {
return m(".component.app-page.important-page", [
m(LHSNav),
m(ImportantRHS),
vnode.children,
]);
}
};
var MailContent = {
oninit: function() {
this.subpage = "inbox";
},
view: function() {
var path = m.route.get();
// Decide *which* view to show
switch (path) {
case "/starred": return m(StarredPage);
case "/draft": return m(DraftPage);
case "/important": return m(ImportantPage);
case "/inbox":
default:
return m(InboxPage, {newCount: 2});
}
}
};
m.route(document.body, "/inbox", {
"/inbox": MailContent,
"/starred": MailContent,
"/draft": MailContent,
"/important": MailContent,
"/inbox": {render: function() { return m(MainLayout, m(InboxMail)); }},
"/starred": {render: function() { return m(MainLayout, m(StarredMail)); }},
"/draft": {render: function() { return m(MainLayout, m(DraftMail)); }},
"/important": {render: function() { return m(MainLayout, m(ImportantMail)); }},
});
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="gray" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-loader"><line x1="12" y1="2" x2="12" y2="6"></line><line x1="12" y1="18" x2="12" y2="22"></line><line x1="4.93" y1="4.93" x2="7.76" y2="7.76"></line><line x1="16.24" y1="16.24" x2="19.07" y2="19.07"></line><line x1="2" y1="12" x2="6" y2="12"></line><line x1="18" y1="12" x2="22" y2="12"></line><line x1="4.93" y1="19.07" x2="7.76" y2="16.24"></line><line x1="16.24" y1="7.76" x2="19.07" y2="4.93"></line></svg>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment