X-Git-Url: https://jasonwoof.com/gitweb/?p=hexbog.git;a=blobdiff_plain;f=main.coffee;h=147b76a2ff4680e47cd7b2881ea122ae5aac5db2;hp=c0524a09f97fb031dc4bf726b99e2271e316eeb2;hb=643696e68d5a23c907592334432796738fcc288c;hpb=ce432c1db2457df41346e82eba9838ab3708449e diff --git a/main.coffee b/main.coffee index c0524a0..147b76a 100644 --- a/main.coffee +++ b/main.coffee @@ -332,9 +332,13 @@ unselect_tile = -> update_selection_display() _unselect_tile = -> - html_tile = selected.pop().dom - html_tile.removeClass 'selected_word' - html_tile.removeClass 'selected' + tile = selected.pop() + dom = tile.dom + if tile.connector? + tile.connector.remove() + delete tile.connector + dom.removeClass 'selected_word' + dom.removeClass 'selected' unselect_all = -> while selected.length @@ -599,10 +603,12 @@ score_for = (word) -> Math.round(Math.pow(1.7, word.length)) activate_selection = -> word = selected_word() if word.length < 3 + # should only happen when trying to blip a word with the keyboard # FIXME make this a hint log "Too short: \"#{word}\"" return unless is_word word + # should only happen when trying to blip a word with the keyboard # FIXME make this automatically part of the selection display log "Not on word list: \"#{word}\"" return @@ -625,9 +631,48 @@ show_definition = (word, type, definition, language) -> html += '