Skip to content

Commit 39d92cc

Browse files
committed
refactor: image options box styling optimize
1 parent d2fc4b1 commit 39d92cc

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,9 +1779,11 @@ function RemoteFunctions(config = {}) {
17791779
</span>`;
17801780
}
17811781

1782+
const selectedClass = imageGallerySelected ? 'class="selected"' : "";
1783+
17821784
// if its an image element, we show the image gallery icon
17831785
if (this.element && this.element.tagName.toLowerCase() === 'img') {
1784-
content += `<span data-action="image-gallery" title="${strings.imageGallery}">
1786+
content += `<span data-action="image-gallery" ${selectedClass} title="${strings.imageGallery}">
17851787
${icons.imageGallery}
17861788
</span>`;
17871789
}
@@ -1799,10 +1801,6 @@ function RemoteFunctions(config = {}) {
17991801
</div>`;
18001802

18011803
let styles = cssStyles.optionsBox;
1802-
// to highlight that in a different color, to show the selected state
1803-
if (imageGallerySelected) {
1804-
styles += cssStyles.optionsBoxImageGallerySelected;
1805-
}
18061804

18071805
// add everything to the shadow box
18081806
shadow.innerHTML = `<style>${styles}</style><div class="phoenix-more-options-box">${content}</div>`;

src/extensionsIntegrated/phoenix-pro/remote-styles.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,12 @@ define(function (require, exports, module) {
5454
height: 16px !important;
5555
display: block !important;
5656
}
57-
`;
5857
59-
const optionsBoxImageGallerySelectedStyles = `
60-
.node-options span[data-action="image-gallery"] {
58+
.node-options span[data-action="image-gallery"].selected {
6159
background-color: rgba(50, 50, 220, 0.5) !important;
6260
}
6361
64-
.node-options span[data-action="image-gallery"]:hover {
62+
.node-options span[data-action="image-gallery"].selected:hover {
6563
background-color: rgba(100, 100, 230, 0.6) !important;
6664
}
6765
`;
@@ -979,7 +977,6 @@ define(function (require, exports, module) {
979977

980978
const remoteStyles = {
981979
optionsBox: optionsBoxStyles,
982-
optionsBoxImageGallerySelected: optionsBoxImageGallerySelectedStyles,
983980
optionsBoxDropdown: optionsBoxDropdownStyles,
984981
infoBox: infoBoxStyles,
985982
toastMessage: toastMessageStyles,

0 commit comments

Comments
 (0)