Skip to content

Commit 49acd8a

Browse files
committed
add tooltip
1 parent 3e699a9 commit 49acd8a

10 files changed

Lines changed: 95 additions & 23 deletions

File tree

browser/main/Detail/MarkdownNoteDetail.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,20 @@ class MarkdownNoteDetail extends React.Component {
263263
/>
264264
<button styleName='info-right-button'
265265
onClick={(e) => this.handleShareButtonClick(e)}
266+
disabled
266267
>
267268
<i className='fa fa-share-alt fa-fw'/>
269+
<span styleName='info-right-button-tooltip'
270+
style={{right: 20}}
271+
>Share Note</span>
268272
</button>
269273
<button styleName='info-right-button'
270274
onClick={(e) => this.handleContextButtonClick(e)}
271275
>
272276
<i className='fa fa-ellipsis-v'/>
277+
<span styleName='info-right-button-tooltip'
278+
style={{right: 5}}
279+
>More Options</span>
273280
</button>
274281
</div>
275282
</div>

browser/main/Detail/MarkdownNoteDetail.styl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,18 @@ $info-height = 75px
7777
padding 0
7878
&:active
7979
border-color $ui-button--focus-borderColor
80-
&:hover .left-control-newPostButton-tooltip
81-
display block
80+
&:hover .info-right-button-tooltip
81+
opacity 1
8282
&:focus
8383
border-color $ui-button--focus-borderColor
8484

85+
.info-right-button-tooltip
86+
tooltip()
87+
position fixed
88+
top 45px
89+
padding 5px
90+
opacity 0
91+
8592
.body
8693
absolute bottom left right
8794
top $info-height

browser/main/Detail/SnippetNoteDetail.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,20 @@ class SnippetNoteDetail extends React.Component {
434434
/>
435435
<button styleName='info-right-button'
436436
onClick={(e) => this.handleShareButtonClick(e)}
437+
disabled
437438
>
438439
<i className='fa fa-share-alt fa-fw'/>
440+
<span styleName='info-right-button-tooltip'
441+
style={{right: 20}}
442+
>Share Note</span>
439443
</button>
440444
<button styleName='info-right-button'
441445
onClick={(e) => this.handleContextButtonClick(e)}
442446
>
443447
<i className='fa fa-ellipsis-v'/>
448+
<span styleName='info-right-button-tooltip'
449+
style={{right: 5}}
450+
>More Options</span>
444451
</button>
445452
</div>
446453
</div>

browser/main/Detail/SnippetNoteDetail.styl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,16 @@ $info-height = 75px
7777
padding 0
7878
&:active
7979
border-color $ui-button--focus-borderColor
80-
&:hover .left-control-newPostButton-tooltip
81-
display block
80+
&:hover .info-right-button-tooltip
81+
opacity 1
8282
&:focus
8383
border-color $ui-button--focus-borderColor
84+
.info-right-button-tooltip
85+
tooltip()
86+
position fixed
87+
top 45px
88+
padding 5px
89+
opacity 0
8490

8591
.body
8692
absolute bottom left right

browser/main/Detail/StarButton.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ class StarButton extends React.Component {
4747
onMouseLeave={(e) => this.handleMouseLeave(e)}
4848
onClick={this.props.onClick}
4949
>
50-
<i className={this.state.isActive || this.props.isActive
51-
? 'fa fa-star'
52-
: 'fa fa-star-o'
53-
}
50+
<i styleName='icon'
51+
className={this.state.isActive || this.props.isActive
52+
? 'fa fa-star'
53+
: 'fa fa-star-o'
54+
}
5455
/>
56+
<span styleName='tooltip'>Star Note</span>
5557
</button>
5658
)
5759
}
Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
.root
22
position relative
33
padding 0
4-
transition transform 0.15s
54
&:hover
6-
transform rotate(-72deg)
5+
.icon
6+
transform rotate(-72deg)
7+
.tooltip
8+
opacity 1
9+
710

811
.root--active
912
@extend .root
1013
color $ui-active-color
11-
transform rotate(-72deg)
14+
.icon
15+
transform rotate(-72deg)
16+
.icon
17+
transition transform 0.15s
18+
19+
.tooltip
20+
tooltip()
21+
position fixed
22+
top 45px
23+
right 65px
24+
padding 5px
25+
opacity 0

browser/main/TopBar/TopBar.styl

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,17 @@ $control-height = 34px
8888
padding 0
8989
&:active
9090
border-color $ui-button--active-backgroundColor
91-
&:hover .left-control-newPostButton-tooltip
92-
display block
91+
&:hover .control-newPostButton-tooltip
92+
opacity 1
9393

9494
.control-newPostButton-tooltip
95+
tooltip()
9596
position fixed
96-
line-height 1.4
97-
background-color $ui-tooltip-backgroundColor
98-
color $ui-tooltip-text-color
99-
font-size 10px
100-
margin-left -25px
101-
margin-top 5px
102-
padding 5px
103-
z-index 1
104-
border-radius 5px
105-
display none
10697
pointer-events none
98+
top 45px
99+
left 385px
100+
z-index 10
101+
padding 5px
102+
line-height normal
103+
opacity 0
104+
transition 0.1s

browser/main/modals/PreferencesModal/StorageItem.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,16 +313,25 @@ class StorageItem extends React.Component {
313313
onClick={(e) => this.handleNewFolderButtonClick(e)}
314314
>
315315
<i className='fa fa-plus'/>
316+
<span styleName='header-control-button-tooltip'
317+
style={{left: -20}}
318+
>Add Folder</span>
316319
</button>
317320
<button styleName='header-control-button'
318321
onClick={(e) => this.handleExternalButtonClick(e)}
319322
>
320323
<i className='fa fa-external-link'/>
324+
<span styleName='header-control-button-tooltip'
325+
style={{left: -50}}
326+
>Open Storage folder</span>
321327
</button>
322328
<button styleName='header-control-button'
323329
onClick={(e) => this.handleUnlinkButtonClick(e)}
324330
>
325331
<i className='fa fa-unlink'/>
332+
<span styleName='header-control-button-tooltip'
333+
style={{left: -10}}
334+
>Unlink</span>
326335
</button>
327336
</div>
328337
</div>

browser/main/modals/PreferencesModal/StorageItem.styl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,21 @@
4747
border-radius 2px
4848
border $ui-border
4949
margin-right 5px
50+
position relative
5051
&:last-child
5152
margin-right 0
53+
&:hover
54+
.header-control-button-tooltip
55+
opacity 1
56+
57+
.header-control-button-tooltip
58+
tooltip()
59+
position absolute
60+
opacity 0
61+
padding 5px
62+
top 25px
63+
z-index 10
64+
white-space nowrap
5265

5366
.folderList-item
5467
height 35px

browser/styles/index.styl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ $ui-tooltip-text-color = white
2929
$ui-tooltip-backgroundColor = alpha(#444, 70%)
3030
$ui-tooltip-button-backgroundColor = #D1D1D1
3131
$ui-tooltip-button--hover-backgroundColor = lighten(#D1D1D1, 30%)
32+
$ui-tooltip-font-size = 12px
33+
34+
tooltip()
35+
background-color $ui-tooltip-backgroundColor = alpha(#444, 70%)
36+
color $ui-tooltip-text-color = white
37+
font-size $ui-tooltip-font-size
38+
pointer-events none
39+
transition 0.1s
40+
3241

3342
// UI Input
3443
$ui-input--focus-borderColor = #369DCD

0 commit comments

Comments
 (0)