Move app theming from index to app view (#1479)

Apply theming one level higher so it applies to the debug log.

// FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-09-14 15:03:53 -07:00
parent fe4738a6e8
commit 48f625c392
No known key found for this signature in database
GPG key ID: A4931C09644C654B
5 changed files with 26 additions and 25 deletions

View file

@ -7,11 +7,20 @@
initialize: function(options) { initialize: function(options) {
this.inboxView = null; this.inboxView = null;
this.installView = null; this.installView = null;
this.applyTheme();
}, },
events: { events: {
'click .openInstaller': 'openInstaller', 'click .openInstaller': 'openInstaller',
'click .openStandalone': 'openStandalone', 'click .openStandalone': 'openStandalone',
'openInbox': 'openInbox', 'openInbox': 'openInbox',
'change-theme': 'applyTheme'
},
applyTheme: function() {
var theme = storage.get('theme-setting') || 'android';
this.$el.removeClass('ios')
.removeClass('android-dark')
.removeClass('android')
.addClass(theme);
}, },
openView: function(view) { openView: function(view) {
this.el.innerHTML = ""; this.el.innerHTML = "";

View file

@ -78,19 +78,11 @@
Whisper.InboxView = Whisper.View.extend({ Whisper.InboxView = Whisper.View.extend({
templateName: 'two-column', templateName: 'two-column',
className: 'inbox index', className: 'inbox index',
applyTheme: function() {
var theme = storage.get('theme-setting') || 'android';
this.$el.removeClass('ios')
.removeClass('android-dark')
.removeClass('android')
.addClass(theme);
},
initialize: function (options) { initialize: function (options) {
options = options || {}; options = options || {};
this.ready = false; this.ready = false;
this.render(); this.render();
this.applyTheme();
this.$el.attr('tabindex', '1'); this.$el.attr('tabindex', '1');
new Whisper.FontSizeView({ el: this.$el }); new Whisper.FontSizeView({ el: this.$el });
this.conversation_stack = new Whisper.ConversationStack({ this.conversation_stack = new Whisper.ConversationStack({
@ -223,7 +215,6 @@
showSettings: function() { showSettings: function() {
var view = new Whisper.SettingsView(); var view = new Whisper.SettingsView();
view.$el.appendTo(this.el); view.$el.appendTo(this.el);
view.$el.on('change-theme', this.applyTheme.bind(this));
}, },
filterContacts: function(e) { filterContacts: function(e) {
this.searchView.filterContacts(e); this.searchView.filterContacts(e);

View file

@ -13,6 +13,7 @@ body {
margin: 0; margin: 0;
font-family: $roboto; font-family: $roboto;
font-size: 14px; font-size: 14px;
color: $grey_d;
} }
.clearfix:before, .clearfix:before,

View file

@ -180,7 +180,6 @@ input.search {
} }
.index { .index {
color: $grey_d;
.gutter .new-group-update-form { .gutter .new-group-update-form {
display: none; display: none;

View file

@ -29,7 +29,8 @@ body {
width: 100%; width: 100%;
margin: 0; margin: 0;
font-family: Roboto, "Helvetica Neue", Arial, Helvetica, sans-serif; font-family: Roboto, "Helvetica Neue", Arial, Helvetica, sans-serif;
font-size: 14px; } font-size: 14px;
color: #454545; }
.clearfix:before, .clearfix:before,
.clearfix:after { .clearfix:after {
@ -1008,16 +1009,16 @@ input.search {
.new-contact.valid { .new-contact.valid {
opacity: 1.0; } opacity: 1.0; }
.index { .index .gutter .new-group-update-form {
color: #454545; }
.index .gutter .new-group-update-form {
display: none; display: none;
padding: 0.5em; } padding: 0.5em; }
.index .last-message {
.index .last-message {
margin: 6px 0 0; margin: 6px 0 0;
font-size: 0.9285714286em; font-size: 0.9285714286em;
font-weight: 300; } font-weight: 300; }
.index .gutter .timestamp {
.index .gutter .timestamp {
position: absolute; position: absolute;
top: 14px; top: 14px;
right: 12px; right: 12px;