-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
93 additions
and
21 deletions.
There are no files selected for viewing
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,21 @@ | ||
+component(tooltip) | ||
|
||
position: fixed | ||
background-color: $granny-green | ||
color: $snow-white | ||
padding: .5em 1.5em | ||
border-radius: 3px | ||
transform: translateX(-50%) | ||
|
||
&:after | ||
|
||
content: '' | ||
position: absolute | ||
left: 50% | ||
top: 100% | ||
transform: translateX(-50%) | ||
width: 0 | ||
height: 0 | ||
border-style: solid | ||
border-width: 10px 10px 0 10px | ||
border-color: $granny-green transparent transparent transparent |
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
@import 'ext/reset'; | ||
@import 'ext/variables'; | ||
@import 'ext/mixins'; | ||
@import 'ext/fonts'; | ||
|
||
@import 'component/global/container'; | ||
@import 'component/global/button'; | ||
@import 'component/global/button-bar'; | ||
@import 'component/global/message'; | ||
@import 'component/global/tooltip'; | ||
|
||
@import 'component/tree/tree'; | ||
@import 'component/tree/node'; | ||
|
||
@import 'component/flash/flash-box'; | ||
@import 'component/flash/flash-message'; | ||
|
||
@import 'component/team/team'; | ||
@import 'component/team/team-form'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,5 @@ | |
|
||
<ul> | ||
<li>Edit Team name</li> | ||
<li>Winner in gold</li> | ||
<li>Remove all team button</li> | ||
</ul> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import {Directive} from "angular2/core"; | ||
import {Input} from "angular2/core"; | ||
import {ElementRef} from "angular2/core"; | ||
import {el} from "angular2/testing_internal"; | ||
|
||
@Directive({ | ||
selector: '[tooltip]', | ||
host: { | ||
'(mouseenter)': 'show()', | ||
'(mouseleave)': 'hide()' | ||
} | ||
}) | ||
export class TooltipDirective { | ||
|
||
@Input('tooltip') text: string; | ||
|
||
private _tooltip: HTMLElement; | ||
|
||
constructor( | ||
private _element: ElementRef | ||
) {} | ||
|
||
show(): void { | ||
var el = this._element.nativeElement; | ||
let position = el.getBoundingClientRect(); | ||
let top = position.top - position.height - 10; | ||
let left = position.right - (position.width/2); | ||
|
||
this._tooltip = this.getTooltipDom(); | ||
|
||
el.appendChild(this._tooltip); | ||
|
||
this._tooltip.style.left = left + 'px'; | ||
this._tooltip.style.top = top + 'px'; | ||
} | ||
|
||
hide(): void { | ||
this._element.nativeElement.removeChild(this._tooltip); | ||
} | ||
|
||
private getTooltipDom(): HTMLElement { | ||
let string: string = '<div class="tooltip">' + this.text + '</div>'; | ||
let div: HTMLElement = document.createElement('div'); | ||
|
||
div.innerHTML = string; | ||
|
||
return div.firstChild; | ||
} | ||
} |
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