Commit 2fe23ad1 authored by Bryce Johnson's avatar Bryce Johnson

Clean up title-tooltip directive and component.

parent 4a006c34
...@@ -10,13 +10,10 @@ ...@@ -10,13 +10,10 @@
Vue.directive('tooltip-title', { Vue.directive('tooltip-title', {
update(el, binding) { update(el, binding) {
const titleInitAttr = 'title'; const updatedValue = binding.value || el.getAttribute('title');
const titleStoreAttr = 'data-original-title';
const updatedValue = binding.value || el.getAttribute(titleInitAttr); el.setAttribute('title', updatedValue);
el.setAttribute('data-original-title', updatedValue);
el.setAttribute(titleInitAttr, updatedValue);
el.setAttribute(titleStoreAttr, updatedValue);
}, },
}); });
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
data: function() { data: function() {
return { return {
displayHelp: false, displayHelp: false,
loading: false,
} }
}, },
computed: { computed: {
...@@ -27,6 +26,7 @@ ...@@ -27,6 +26,7 @@
showHelp() { showHelp() {
return !!this.displayHelp; return !!this.displayHelp;
}, },
/* Parsed time values */ /* Parsed time values */
parsedEstimate() { parsedEstimate() {
return this.parseSeconds(this.time_estimate); return this.parseSeconds(this.time_estimate);
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
const diffSeconds = this.time_estimate - this.time_spent; const diffSeconds = this.time_estimate - this.time_spent;
return this.parseSeconds(diffSeconds); return this.parseSeconds(diffSeconds);
}, },
/* Human readable time values */ /* Human readable time values */
estimatedPretty() { estimatedPretty() {
return this.stringifyTime(this.parsedEstimate); return this.stringifyTime(this.parsedEstimate);
...@@ -52,6 +53,7 @@ ...@@ -52,6 +53,7 @@
const prefix = this.diffMinutes < 0 ? 'Over by' : 'Time remaining:'; const prefix = this.diffMinutes < 0 ? 'Over by' : 'Time remaining:';
return `${prefix} ${this.remainingPretty}`; return `${prefix} ${this.remainingPretty}`;
}, },
/* Diff values for comparison meter */ /* Diff values for comparison meter */
diffMinutes () { diffMinutes () {
const time_estimate = this.time_estimate; const time_estimate = this.time_estimate;
...@@ -72,7 +74,6 @@ ...@@ -72,7 +74,6 @@
}, },
parseSeconds (seconds) { parseSeconds (seconds) {
const DAYS_PER_WEEK = 5, HOURS_PER_DAY = 8, MINUTES_PER_HOUR = 60; const DAYS_PER_WEEK = 5, HOURS_PER_DAY = 8, MINUTES_PER_HOUR = 60;
const MINUTES_PER_WEEK = DAYS_PER_WEEK * HOURS_PER_DAY * MINUTES_PER_HOUR; const MINUTES_PER_WEEK = DAYS_PER_WEEK * HOURS_PER_DAY * MINUTES_PER_HOUR;
const MINUTES_PER_DAY = HOURS_PER_DAY * MINUTES_PER_HOUR; const MINUTES_PER_DAY = HOURS_PER_DAY * MINUTES_PER_HOUR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment