Skip to content

Commit

Permalink
chore(tickets): added clear to due date
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Apr 13, 2019
1 parent 9208a33 commit 746d5c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/public/js/angularjs/controllers/singleTicket.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,21 @@ define([
}
}

$scope.clearDueDate = function ($event) {
$event.preventDefault()
var id = $('#__ticketId').html()
if (id.length > 0) {
socket.ui.setTicketDueDate(id, null)
}
}

function onSocketUpdateTicketDueDate () {
socket.socket.removeAllListeners('updateTicketDueDate')
socket.socket.on('updateTicketDueDate', function (data) {
$timeout(function () {
if ($scope.ticketId === data._id)
$scope.dueDate = helpers.formatDate(data.dueDate, helpers.getShortDateFormat())
if (data.dueDate) $scope.dueDate = helpers.formatDate(data.dueDate, helpers.getShortDateFormat())
else $scope.dueDate = ''
}, 0)
// var dueDateInput = $('input#tDueDate[data-ticketId="' + data._id + '"]')
// if (dueDateInput.length > 0) {
Expand Down
1 change: 1 addition & 0 deletions src/views/subviews/singleticket.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
<div class="uk-width-1-1 p-0">
<span>Due Date</span>
{{#hasPermOverRole data.ticket.owner.role data.common.loggedInAccount.role "tickets:update"}}
- <a href="#" class="no-ajaxy" ng-click="clearDueDate($event)">Clear</a>
<input
id="tDueDate"
type="text"
Expand Down

0 comments on commit 746d5c0

Please sign in to comment.