1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Can scroll through items and open URL of ticket

This commit is contained in:
Tim Fitzgerald 2018-07-25 14:41:21 -07:00
parent 626cbe0883
commit 7ad7e2ccfd

View File

@ -103,7 +103,8 @@ 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)
}
}
@ -111,16 +112,6 @@ 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":