-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tooltips to the visualization wrapper
- Loading branch information
Max Lang
committed
Apr 12, 2016
1 parent
e605957
commit 30e0b52
Showing
9 changed files
with
106 additions
and
5 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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
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,32 @@ | ||
// source: component/tooltip.ts | ||
/// <reference path="../../bower_components/mithriljs/mithril.d.ts" /> | ||
|
||
module Components { | ||
"use strict"; | ||
|
||
/** | ||
* Tooltip is a component that creates a configureable tooltip | ||
*/ | ||
export module Tooltip { | ||
import MithrilVirtualElement = _mithril.MithrilVirtualElement; | ||
|
||
interface TooltipConfig { | ||
// Class applied to the tooltip | ||
tooltipClass?: string; | ||
title?: string; | ||
content: (string|MithrilVirtualElement|MithrilVirtualElement[]|(MithrilVirtualElement|string)[]); | ||
icon?: string; | ||
position?: string; | ||
} | ||
|
||
export function controller(): any {} | ||
|
||
export function view(ctrl: any, tooltipConfig: TooltipConfig): _mithril.MithrilVirtualElement { | ||
return m(".tooltip" + (tooltipConfig.position || ".right") + (tooltipConfig.tooltipClass || ""), [ | ||
tooltipConfig.icon ? m(tooltipConfig.icon) : m(""), | ||
m(".title", tooltipConfig.title ? tooltipConfig.title : ""), | ||
m(".content", tooltipConfig.content), | ||
]); | ||
} | ||
} | ||
} |
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
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