diff --git a/modules/route/front/tickets/index.html b/modules/route/front/tickets/index.html index 1789093a7..49ad5c359 100644 --- a/modules/route/front/tickets/index.html +++ b/modules/route/front/tickets/index.html @@ -7,8 +7,7 @@ auto-load="true"> + model="model">
@@ -34,7 +33,7 @@ - + @@ -57,25 +56,17 @@ - + + ng-model="ticket.checked"> + tabindex="-1"> @@ -83,8 +74,7 @@ on-change="$ctrl.setPriority(ticket.id, ticket.priority)" ng-model="ticket.priority" rule="Ticket" - class="dense" - vn-click-stop> + class="dense"> {{::ticket.street}} @@ -93,8 +83,7 @@ + class="link"> {{::ticket.nickname}} @@ -103,8 +92,7 @@ + class="link"> {{::ticket.id}} @@ -113,8 +101,7 @@ ng-if="::ticket.notes.length" title="{{::ticket.notes[0].description}}" icon="insert_drive_file" - class="bright" - vn-click-stop> + class="bright"> @@ -122,8 +109,7 @@ translate-attr="{title: 'Remove ticket'}" icon="delete" ng-click="$ctrl.showDeleteConfirm(ticket.id)" - tabindex="-1" - vn-click-stop> + tabindex="-1"> @@ -131,8 +117,7 @@ ng-if="::ticket.description" vn-tooltip="{{::ticket.description}}" icon="icon-notes" - tabindex="-1" - vn-click-stop> + tabindex="-1"> diff --git a/modules/route/front/tickets/index.js b/modules/route/front/tickets/index.js index f32f02341..6d3744031 100644 --- a/modules/route/front/tickets/index.js +++ b/modules/route/front/tickets/index.js @@ -4,10 +4,6 @@ import './style.scss'; import UserError from 'core/lib/user-error'; class Controller extends Section { - constructor($element, $, vnReport) { - super($element, $); - this.droppableElement = 'a.vn-tr'; - } get isChecked() { if (this.tickets) { for (let instance of this.tickets) @@ -124,10 +120,20 @@ class Controller extends Section { } onDrop($event) { - const target = $event.target; - const droppable = target.closest(this.droppableElement); - const ticketId = droppable.id; - console.log($event, target, droppable, ticketId); + const ticketId = $event.dataTransfer.getData('Text'); + + if (isNaN(ticketId)) { + const regexp = new RegExp(/\/ticket\/([0-9]+)\//i); + const matches = ticketId.match(regexp); + + if (matches && matches.length) + this.insert(matches[1]); + else + this.vnApp.showError(this.$t('Ticket not found')); + } + + if (!isNaN(ticketId)) + this.insert(ticketId); } insert(ticketId) {