Skip to content

Commit

Permalink
Settings WebUI: fix row lines on "Get Started" section
Browse files Browse the repository at this point in the history
  • Loading branch information
petemill committed Jul 1, 2020
1 parent f6a08b2 commit 7b772c8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
30 changes: 30 additions & 0 deletions browser/resources/settings/brave_overrides/default_browser_page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) 2020 The Brave Authors. All rights reserved.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.

import {RegisterPolymerTemplateModifications} from 'chrome://brave-resources/polymer_overriding.js'

function queryInAllTemplates(element, selector, onFound) {
if (!element) {
return
}
for (const foundElement of element.querySelectorAll(selector)) {
onFound(foundElement)
}
for (const foundTemplate of element.querySelectorAll('template')) {
if (foundTemplate.content) {
queryInAllTemplates(foundTemplate.content, selector, onFound)
}
}
}

RegisterPolymerTemplateModifications({
'settings-default-browser-page': (templateContent) => {
// Stop both versions thinking they are the first, since this item is added
// to Brave's "Get Started" section.
queryInAllTemplates(templateContent, '.cr-row.first', function (element) {
element.classList.remove('first')
})
}
})
1 change: 1 addition & 0 deletions browser/resources/settings/brave_overrides/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import './about_page.js'
import './appearance_page.js'
import './basic_page.js'
import './clear_browsing_data_dialog.js'
import './default_browser_page.js'
import './icons.js'
import './import_data_dialog.js'
import './page_visibility.js'
Expand Down
5 changes: 5 additions & 0 deletions browser/resources/settings/settings_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
compress="false"
preprocess="true"
type="BINDATA" />
<include name="IDR_SETTINGS_BRAVE_OVERRIDES_DEFAULT_BROWSER_PAGE_JS"
file="brave_overrides/default_browser_page.js"
compress="false"
preprocess="true"
type="BINDATA" />
<include name="IDR_SETTINGS_BRAVE_OVERRIDES_ICONS_JS"
file="brave_overrides/icons.js"
compress="false"
Expand Down

0 comments on commit 7b772c8

Please sign in to comment.