diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-11-19 18:49:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-19 18:49:30 -0500 |
commit | 1216926fbdb6b897f4cf9d4cb25d3aaef86707d1 (patch) | |
tree | 36c22b444938fa9d4606ccc6ab4e466531a93917 /ext | |
parent | e5255a03e68574afecced794f8092bf76ec241a3 (diff) |
Hide profile button if only one profile exists (#1045)
Diffstat (limited to 'ext')
-rw-r--r-- | ext/bg/context.html | 2 | ||||
-rw-r--r-- | ext/bg/css/context.css | 3 | ||||
-rw-r--r-- | ext/bg/js/context-main.js | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/ext/bg/context.html b/ext/bg/context.html index 1eb9c058..34f0d1e1 100644 --- a/ext/bg/context.html +++ b/ext/bg/context.html @@ -25,7 +25,7 @@ </div> </label> <div class="nav-button-container"> - <button class="nav-button action-select-profile" data-icon="profile" title="Change primary profile"> + <button class="nav-button action-select-profile" data-icon="profile" title="Change primary profile" hidden> <span class="profile-select-container"><select class="profile-select" id="profile-select"> <optgroup label="Primary Profile" id="profile-select-option-group"></optgroup> </select></span> diff --git a/ext/bg/css/context.css b/ext/bg/css/context.css index c1e88ef5..3d1dceb2 100644 --- a/ext/bg/css/context.css +++ b/ext/bg/css/context.css @@ -288,7 +288,8 @@ body[data-loaded=true] .toggle-group { mask-image: url(/mixed/img/profile.svg); -webkit-mask-image: url(/mixed/img/profile.svg); } -.nav-button:first-child { +.nav-button:first-child, +.nav-button:first-child[hidden]+.nav-button { border-top-left-radius: 3px; border-bottom-left-radius: 3px; } diff --git a/ext/bg/js/context-main.js b/ext/bg/js/context-main.js index e7cff04c..93eebe72 100644 --- a/ext/bg/js/context-main.js +++ b/ext/bg/js/context-main.js @@ -42,6 +42,8 @@ class DisplayController { this._setupOptions(primaryProfile); } + document.querySelector('.action-select-profile').hidden = (profiles.length <= 1); + this._updateProfileSelect(profiles, profileCurrent); setTimeout(() => { |