diff --git a/public_html/js/BrowsingSettings.js b/public_html/js/BrowsingSettings.js index 142958d8..4f1f3fd4 100644 --- a/public_html/js/BrowsingSettings.js +++ b/public_html/js/BrowsingSettings.js @@ -33,6 +33,7 @@ App.BrowsingSettings = function( unsafe: true, }, keyboardShortcuts: true, + fitMode: 'fit-width', }; } @@ -91,7 +92,6 @@ App.BrowsingSettings = function( getSettings: getSettings, setSettings: setSettings, }; - }; App.DI.registerSingleton('browsingSettings', ['promise', 'auth', 'api'], App.BrowsingSettings); diff --git a/public_html/js/Presenters/PostContentPresenter.js b/public_html/js/Presenters/PostContentPresenter.js index d5e0b15c..30a9a8e3 100644 --- a/public_html/js/Presenters/PostContentPresenter.js +++ b/public_html/js/Presenters/PostContentPresenter.js @@ -7,7 +7,8 @@ App.Presenters.PostContentPresenter = function( promise, keyboard, presenterManager, - postNotesPresenter) { + postNotesPresenter, + browsingSettings) { var post; var templates = {}; @@ -72,7 +73,7 @@ App.Presenters.PostContentPresenter = function( updatePostNotesSize(); } - changeFitMode('fit-width'); + changeFitMode(browsingSettings.getSettings().fitMode); keyboard.keyup('f', cycleFitMode); jQuery(window).resize(updatePostNotesSize); @@ -114,5 +115,6 @@ App.DI.register('postContentPresenter', [ 'promise', 'keyboard', 'presenterManager', - 'postNotesPresenter'], + 'postNotesPresenter', + 'browsingSettings'], App.Presenters.PostContentPresenter); diff --git a/public_html/js/Presenters/UserBrowsingSettingsPresenter.js b/public_html/js/Presenters/UserBrowsingSettingsPresenter.js index 43bea35e..db129e21 100644 --- a/public_html/js/Presenters/UserBrowsingSettingsPresenter.js +++ b/public_html/js/Presenters/UserBrowsingSettingsPresenter.js @@ -52,6 +52,7 @@ App.Presenters.UserBrowsingSettingsPresenter = function( unsafe: $el.find('[name=listUnsafePosts]').is(':checked'), }, keyboardShortcuts: $el.find('[name=keyboardShortcuts]').is(':checked'), + fitMode: $el.find('[name=fitMode]:checked').val(), }; promise.wait(browsingSettings.setSettings(newSettings)) diff --git a/public_html/templates/browsing-settings.tpl b/public_html/templates/browsing-settings.tpl index 20b029e1..fc51a058 100644 --- a/public_html/templates/browsing-settings.tpl +++ b/public_html/templates/browsing-settings.tpl @@ -51,6 +51,26 @@ +