From e5a019390d91890bd098511f4845e27ff7bda430 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Fri, 9 Oct 2015 16:45:40 -0400 Subject: [PATCH 1/2] Fixed download links in Safari --- api/file.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/file.go b/api/file.go index 9ebcd821be..4293475969 100644 --- a/api/file.go +++ b/api/file.go @@ -408,11 +408,11 @@ func getFile(c *Context, w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Length", strconv.Itoa(len(f))) w.Header().Del("Content-Type") // Content-Type will be set automatically by the http writer - // attach extra headers to trigger a download on IE and Edge + // attach extra headers to trigger a download on IE, Edge, and Safari ua := user_agent.New(r.UserAgent()) bname, _ := ua.Browser() - if bname == "Edge" || bname == "Internet Explorer" { + if bname == "Edge" || bname == "Internet Explorer" || bname == "Safari" { // trim off anything before the final / so we just get the file's name parts := strings.Split(filename, "/") From fd4bfee6ea393b6b707919b5da805a6a46e72d1a Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Mon, 12 Oct 2015 19:22:05 +0500 Subject: [PATCH 2/2] Multiple UI Improvements --- web/react/components/channel_loader.jsx | 6 ------ web/react/components/settings_sidebar.jsx | 2 +- web/react/components/view_image.jsx | 3 ++- web/react/utils/constants.jsx | 2 +- web/react/utils/utils.jsx | 7 +++++-- web/sass-files/sass/partials/_base.scss | 5 +++++ web/sass-files/sass/partials/_markdown.scss | 9 ++------- web/sass-files/sass/partials/_responsive.scss | 2 +- web/templates/channel.html | 2 +- 9 files changed, 18 insertions(+), 20 deletions(-) diff --git a/web/react/components/channel_loader.jsx b/web/react/components/channel_loader.jsx index d160697252..d0d6ab5e2f 100644 --- a/web/react/components/channel_loader.jsx +++ b/web/react/components/channel_loader.jsx @@ -104,12 +104,6 @@ export default class ChannelLoader extends React.Component { } }); - /* Setup modal events */ - $('.modal').on('show.bs.modal', function onShow() { - $('.modal-body').css('overflow-y', 'auto'); - $('.modal-body').css('max-height', $(window).height() * 0.7); - }); - /* Prevent backspace from navigating back a page */ $(window).on('keydown.preventBackspace', (e) => { if (e.which === 8 && !$(e.target).is('input, textarea')) { diff --git a/web/react/components/settings_sidebar.jsx b/web/react/components/settings_sidebar.jsx index b5d2132d7a..66568e1c86 100644 --- a/web/react/components/settings_sidebar.jsx +++ b/web/react/components/settings_sidebar.jsx @@ -10,7 +10,7 @@ export default class SettingsSidebar extends React.Component { handleClick(tab, e) { e.preventDefault(); this.props.updateTab(tab.name); - $('.settings-modal').addClass('display--content'); + $(e.target).closest('.settings-modal').addClass('display--content'); } render() { let tabList = this.props.tabs.map(function makeTab(tab) { diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx index 8ef68dd0ac..c5f0abc126 100644 --- a/web/react/components/view_image.jsx +++ b/web/react/components/view_image.jsx @@ -195,6 +195,7 @@ export default class ViewImageModal extends React.Component { target='_blank' > @@ -210,6 +211,7 @@ export default class ViewImageModal extends React.Component { content = (