-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Settings WebUI: fix row lines on "Get Started" section
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
browser/resources/settings/brave_overrides/default_browser_page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | ||
}) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters