Skip to content

Commit

Permalink
Made display density use to global Mailpile.web.config
Browse files Browse the repository at this point in the history
  • Loading branch information
bnvk committed Oct 24, 2014
1 parent b060088 commit 045fac5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion static/default/html/jsapi/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% set config_web = config.web|json %}

// Make console.log not crash JS browsers that don't support it
if (!window.console) window.console = {
log: $.noop,
Expand Down Expand Up @@ -58,7 +60,10 @@ Mailpile = {
commands: [],
graphselected: [],
defaults: {
view_size: "comfy"
view_size: "comfy",
},
config: {
web: {{config_web|safe}}
},
api: {
compose : "/api/0/message/compose/",
Expand Down
4 changes: 3 additions & 1 deletion static/default/html/jsapi/search/display_modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ $(document).on('click', 'a.change-view-size', function(e) {
// Data
localStorage.setItem('view_size', change_size);

// Update Config
// Update Config & Model
Mailpile.API.settings_set_post({ 'web.display_density': change_size }, function(result) {});
Mailpile.config.web.display_density = change_size;

});
2 changes: 1 addition & 1 deletion static/default/html/jsapi/search/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Mailpile.Search.init = function() {

// Render Display Size
if (!localStorage.getItem('view_size')) {
localStorage.setItem('view_size', Mailpile.defaults.view_size);
localStorage.setItem('view_size', Mailpile.config.web.display_density);
}

Mailpile.pile_display(localStorage.getItem('view_size'));
Expand Down

0 comments on commit 045fac5

Please sign in to comment.