Browse Source

fix ff styles for link input and fix tips for Enter - Add/Edit/Navigate and Shift+Tab

main
Marek Piasecki 2 years ago
parent
commit
e72dd1c359
  1. 3
      src/components/app-home.imba
  2. 10
      src/components/app-links.imba

3
src/components/app-home.imba

@ -4,6 +4,7 @@ tag app-home
$home-input.focus!
api.#home_input = $home-input
api.#link_input = $link-input-url
api.#link_title = $link-input-title
def blur
setTimeout(&, 100) do
@ -53,7 +54,7 @@ tag app-home
bg:$input-bg c:$text-c
caret-color:$input-caret-c
<[c:$button-c] @click=delete_link!> "⨯"
<input$link-input-title[ml:17px bdr:0 rdr:0]
<input$link-input-title[ml:17px bdr:0 rdr:0 w:200px]
disabled=state.loading
@blur=blur
placeholder="title"

10
src/components/app-links.imba

@ -10,7 +10,7 @@ tag app-links
hotkey: 'return'
hotkey_display_name: 'Return'
}
temp.content = api.selected_link.is_bang ? "Use Bang" : "Navigate To Link"
temp.content = api.selected_link.is_bang ? "Use Bang" : [api.#link_input, api.#link_title].includes(document.activeElement) ? state.link_selection_index == -1 ? "Add New Link" : "Edit Link" : "Navigate To Link"
result.push temp
temp = {
@ -42,10 +42,16 @@ tag app-links
}
result.push temp
let content = switch document.activeElement
when this.api.#link_title then ""
when this.api.#link_input then "Edit title"
else "Edit link"
if content
temp = {
click_handler: do api.#link_input.focus!
hotkey_display_name: "Shift+Tab"
content: "Edit Link"
content
}
result.push temp

Loading…
Cancel
Save