Skip to content

Commit 53b72dd

Browse files
committed
Add view current active tab
1 parent deaf32a commit 53b72dd

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

src/icons/eye.png

764 Bytes
Loading

src/scripts/ui.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class UI {
7575
var span = this.createElement('span', ['span-time']);
7676
this.createElementsForTotalTime(totalTime, currentTypeOfList, span);
7777

78-
this.appendChild(totalElement, [div, spanVisits, spanPercentage, span]);
78+
this.appendChild(totalElement, [div, spanVisits, spanPercentage, span]);
7979
}
8080

8181
fillEmptyBlock(elementName) {
@@ -120,8 +120,6 @@ class UI {
120120
d3.select('#chart')
121121
.datum(tabs) // bind data to the div
122122
.call(donut); // draw chart in div
123-
124-
ui.addHrAfterChart();
125123
}
126124

127125
drawTimeChart(tabs) {
@@ -175,10 +173,6 @@ class UI {
175173
});
176174
div.classList.add('inline-flex');
177175

178-
if (tab.url == currentTab) {
179-
div.classList.add('span-active-url');
180-
}
181-
182176
var divForImg = document.createElement('div');
183177
var img = document.createElement('img');
184178
img.setAttribute('height', 17);
@@ -190,6 +184,18 @@ class UI {
190184

191185
var spanUrl = this.createElement('span', ['span-url'], tab.url);
192186

187+
if (tab.url == currentTab) {
188+
div.classList.add('span-active-url');
189+
var imgCurrentDomain = document.createElement('img');
190+
imgCurrentDomain.setAttribute('src', '/icons/eye.png');
191+
imgCurrentDomain.setAttribute('height', 17);
192+
imgCurrentDomain.classList.add('margin-left-5');
193+
spanUrl.appendChild(imgCurrentDomain);
194+
var currentDomainTooltip = this.createElement('span', ['tooltiptext'], 'Current domain');
195+
spanUrl.classList.add('tooltip', 'current-url');
196+
spanUrl.appendChild(currentDomainTooltip);
197+
}
198+
193199
if (typeOfList !== undefined && typeOfList === TypeListEnum.ToDay) {
194200
if (restrictionList !== undefined && restrictionList.length > 0) {
195201
var item = restrictionList.find(x => isDomainEquals(x.domain, tab.url));

src/style/webact.css

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,6 @@ body {
3737
cursor: pointer;
3838
}
3939

40-
.span-active-url .span-url{
41-
font-size: 13px;
42-
font-weight: 650;
43-
}
44-
.span-active-url .span-time{
45-
color: rgb(0, 0, 0);
46-
cursor: pointer;
47-
}
48-
4940
.span-total{
5041
width: 450px;
5142
text-decoration: none;
@@ -311,7 +302,7 @@ p.table-header{
311302
font-size: 11px;
312303
font-weight: 500;
313304
visibility: hidden;
314-
width: 220px;
305+
width: 180px;
315306
background-color: #555;
316307
color: #fff;
317308
text-align: center;
@@ -321,7 +312,7 @@ p.table-header{
321312
/* Position the tooltip text */
322313
position: absolute;
323314
z-index: 1;
324-
transform: translateX(-20%) translateY(-120%);
315+
transform: translateX(-40%) translateY(-120%);
325316

326317
/* Fade in tooltip */
327318
opacity: 0;
@@ -332,6 +323,11 @@ p.table-header{
332323
width: 120px;
333324
transform: translateX(-50%) translateY(-120%);
334325
}
326+
327+
.current-url.tooltip .tooltiptext{
328+
width: 120px;
329+
transform: translateX(-50%) translateY(-120%);
330+
}
335331

336332
/* Show the tooltip text when you mouse over the tooltip container */
337333
.tooltip:hover .tooltiptext {

0 commit comments

Comments
 (0)