mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
FEATURE: allow users to persist customization with &sticky=true
This commit is contained in:
parent
e6dba8adc2
commit
a99c3c3df9
1 changed files with 14 additions and 5 deletions
|
@ -171,13 +171,22 @@ class ApplicationController < ActionController::Base
|
||||||
|
|
||||||
def inject_preview_style
|
def inject_preview_style
|
||||||
style = request['preview-style']
|
style = request['preview-style']
|
||||||
if style.blank?
|
|
||||||
session[:preview_style] = nil
|
if style.nil?
|
||||||
elsif style == "default"
|
session[:preview_style] = cookies[:preview_style]
|
||||||
session[:preview_style] = ""
|
|
||||||
else
|
else
|
||||||
session[:preview_style] = style
|
cookies.delete(:preview_style)
|
||||||
|
|
||||||
|
if style.blank? || style == 'default'
|
||||||
|
session[:preview_style] = nil
|
||||||
|
else
|
||||||
|
session[:preview_style] = style
|
||||||
|
if request['sticky']
|
||||||
|
cookies[:preview_style] = style
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def disable_customization
|
def disable_customization
|
||||||
|
|
Loading…
Reference in a new issue