Skip to content

Commit

Permalink
Can scroll through items and open URL of ticket
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Fitzgerald committed Jul 25, 2018
1 parent 626cbe0 commit 7ad7e2c
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions zendesk/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,15 @@ func (widget *Widget) openTicket() {
sel := widget.selected
if sel >= 0 && widget.result != nil && sel < len(widget.result.Tickets) {
issue := &widget.result.Tickets[widget.selected]
wtf.OpenFile(issue.URL)
ticketUrl := fmt.Sprintf("https://%s.zendesk.com/agent/tickets/%d", subdomain, issue.Id)
wtf.OpenFile(ticketUrl)
}
}

func (widget *Widget) unselect() {
widget.selected = -1
}

func (widget *Widget) rowColor(idx int) string {
if widget.View.HasFocus() && (idx == widget.selected) {
foreColor := wtf.Config.UString("wtf.colors.highlight.fore", "black")
backColor := wtf.Config.UString("wtf.colors.highlight.back", "orange")

return fmt.Sprintf("%s:%s", foreColor, backColor)
}
return wtf.RowColor("zendesk", idx)
}

func (widget *Widget) keyboardIntercept(event *tcell.EventKey) *tcell.EventKey {
switch string(event.Rune()) {
case "j":
Expand Down

0 comments on commit 7ad7e2c

Please sign in to comment.