Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
{{usage.title}}

<div class="more-info">
<span class="date-added">{{::ctrl.formatTimestamp(usage.dateAdded)}}</span>
<span title="{{usage.dateAdded | date:'d MMM yyyy, HH:mm'}}" class="date-added">{{::ctrl.formatTimestamp(usage.dateAdded)}}</span>

<ul class="reference-list">
<li ng-repeat="reference in usage.references">
<a ng-if="reference.uri" href="{{reference.uri}}" title="Open in {{reference.type}}" rel="noopener" target="_blank">
Expand Down
32 changes: 24 additions & 8 deletions kahuna/public/js/components/gr-tooltip/gr-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,33 @@ tooltip.directive('grTooltip', [
}

const position = attrs.grTooltipPosition || 'bottom';
element.attr('data-title', attrs.grTooltip)
.addClass(`titip-default`)
.addClass(`titip-${position}`);
element.addClass('titip-default').addClass(`titip-${position}`);

const autoUpdates = angular.isDefined(attrs.grTooltipUpdates);
// Remove any previous .titip-content
element.find('.titip-content').remove();

if (attrs.grTooltipHtml !== undefined) {
// Use .titip-content for HTML tooltips
const content = attrs.grTooltip || '';
const contentSpan = angular.element('<span class="titip-content"></span>');
contentSpan.text(content);
element.append(contentSpan);
} else {
// Use data-title for plain text tooltips
element.attr('data-title', attrs.grTooltip);
}

const autoUpdates = angular.isDefined(attrs.grTooltipUpdates);

if (autoUpdates) {
$scope.$watch(() => attrs.grTooltip, onValChange(newTooltip => {
element.attr('data-title', newTooltip);
}));
$scope.$watch(() => attrs.grTooltip, onValChange(newTooltip => {
if (attrs.grTooltipHtml !== undefined) {
element.find('.titip-content').text(newTooltip);
} else {
element.attr('data-title', newTooltip);
}
}));
}
}
}
};
}]);
1 change: 1 addition & 0 deletions kahuna/public/js/leases/leases.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
<li ng-switch-default
ng-repeat="lease in ctrl.leases.leases"
gr-tooltip="{{ctrl.toolTip(lease)}}"
gr-tooltip-html
class="lease__item"
gr-tooltip-position="bottom">

Expand Down
2 changes: 1 addition & 1 deletion kahuna/public/js/leases/leases.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ leases.controller('LeasesCtrl', [
};

ctrl.toolTip = (lease) => {
return Boolean(lease.leasedBy) ? `leased by: ${lease.leasedBy}` : ``;
return Boolean(lease.leasedBy) ? `leased by: ${lease.leasedBy}\nleased at: ${moment(lease.createdAt).format('D MMM YYYY, HH:mm')}` : ``;
};

ctrl.inactiveLeases = (leases) => {
Expand Down
5 changes: 5 additions & 0 deletions kahuna/public/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -3085,3 +3085,8 @@ FIXME: what to do with touch devices
background-color: teal;
color: white;
}

.titip-default .titip-content {
line-height: 1.4;
white-space: preserve nowrap;
}
Loading