Skip to content

Commit

Permalink
Don't memoize CTS text to localStorage (see ryanfb/cts-cite-driver#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfb committed Mar 7, 2017
1 parent 261f3e4 commit 788e5ea
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/js/cts-cite-driver.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,12 @@ set_cts_text = (urn, head, tlg) ->
$(urn_selector).append(editor_link)
add_translations(urn)

# sets passage from Fusion Tables result row and memoize to localStorage
# sets passage from Fusion Tables result row
set_passage = (passage) ->
urn = passage[0]
head = passage[1]
tlg = passage[2]

localStorage["#{urn}[head]"] = head
localStorage["#{urn}[tlg]"] = tlg

set_cts_text(urn, head, tlg)

show_all = ->
Expand Down Expand Up @@ -124,10 +121,7 @@ add_urn_li = (urn) ->
urn_li = $('<li>').attr('id',urn_to_id(urn[0])).text(urn[0])
$('#valid_urns').append urn_li

if localStorage["#{urn[0]}[head]"]?
set_cts_text(urn[0], localStorage["#{urn[0]}[head]"], localStorage["#{urn[0]}[tlg]"])
else
set_passage(urn)
set_passage(urn)

add_valid_urns = ->
console.log('add_valid_urns')
Expand Down

0 comments on commit 788e5ea

Please sign in to comment.