Skip to content

Commit

Permalink
Tooltip and guide fine tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonykoerber committed May 17, 2016
1 parent 3c69794 commit 2632ad1
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 9 deletions.
17 changes: 16 additions & 1 deletion src/strand-grid-column/doc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,27 @@

{
"name":"minWidth",
"type":"Integer",
"type":"Number",
"description":"The minimum width of the column in pixels when resizing.",
"attribute":"min-width",
"optional":true,
"default":"75"
},
{
"name":"tipWidth",
"type":"Number",
"description":"The desired width of the tooltip for the column, in pixels (see: the 'info' property). For longer multiline tooltips, provide a tip-width for best results.",
"attribute":"min-width",
"optional":true,
"default":"none"
},
{
"name":"info",
"type":"String",
"description":"",
"optional":true,
"default":"false"
},
{
"name":"resize",
"type":"Boolean",
Expand Down
2 changes: 1 addition & 1 deletion src/strand-grid-column/strand-grid-column.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div id="label"></div>
<!-- <template is="dom-if" if="{{info}}"> -->
<strand-icon id="info" hidden$="{{_hasInfoTip(info)}}" width="14" height="14" type="info"></strand-icon>
<strand-tooltip id="infoTip" hidden$="{{_hasInfoTip(info)}}" target="{{findById('info')}}" _scope="{{ref}}">
<strand-tooltip id="infoTip" tip-width="{{tipWidth}}" hidden$="{{_hasInfoTip(info)}}" target="{{findById('info')}}" _scope="{{ref}}">
<label>{{info}}</label>
</strand-tooltip>
<!-- </template> -->
Expand Down
3 changes: 3 additions & 0 deletions src/strand-grid-column/strand-grid-column.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
type: Number,
value: 75
},
tipWidth: {
type: Number
}
},

listeners: {
Expand Down
7 changes: 1 addition & 6 deletions src/strand-grid-column/strand-grid-column.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,8 @@
}

#label {
// TODO: switch this block to the mixin for default font
font-family: "Arimo", sans-serif;
font-weight: bold;
font-size: 11px;
line-height: 11px;
@include defaultFont(11px, 11px, 700);
color: $color-A2;

text-transform: uppercase;
white-space: nowrap;
overflow: hidden;
Expand Down
1 change: 1 addition & 0 deletions src/strand-guide-tooltip/strand-guide-tooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-->
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../shared/fonts/fonts.html"/>
<link rel="import" href="../shared/js/behaviorutils.html"/>
<link rel="import" href="../shared/behaviors/resolvable.html"/>
<link rel="import" href="../shared/behaviors/refable.html"/>
<link rel="import" href="../shared/behaviors/positionable-panel.html"/>
Expand Down
8 changes: 8 additions & 0 deletions src/strand-guide-tooltip/strand-guide-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
(function(scope) {

var BehaviorUtils = StrandLib.BehaviorUtils;

scope.GuideTooltip = Polymer({
is: 'strand-guide-tooltip',

Expand Down Expand Up @@ -72,6 +74,12 @@
}
},

open: function(silent) {
var inherited = BehaviorUtils.findSuper(StrandTraits.Closable, "open");
inherited.apply(this, [silent]);
this._updatePosition();
},

_currentStepChanged: function(newVal, oldVal) {
if (this.currentStep <= this.data.length-1) {
if (this.state === this.STATE_OPENED) this.close();
Expand Down
2 changes: 1 addition & 1 deletion src/strand-guide/strand-guide.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
newVal.forEach(function(item) {
var target = Polymer.dom(this.scope).querySelector('#' + item.target);
item.targetRef = target;
});
}, this);

if (this._isAttached) this._init();
}
Expand Down
2 changes: 2 additions & 0 deletions src/strand-tooltip/strand-tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ $bg-color: $color-A1;
:host {
position: fixed;
display: block;
left: 0;
top: 0;
}

#container {
Expand Down

0 comments on commit 2632ad1

Please sign in to comment.