From 320d9bca0e2f4e4a66e58672898722dfeb28f7d4 Mon Sep 17 00:00:00 2001
From: Alex Yatskov <alex@foosoft.net>
Date: Wed, 4 May 2016 19:31:06 -0700
Subject: Adding indices

---
 ext/fg/js/client.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'ext/fg/js')

diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js
index 1cf1cf6f..8495a354 100644
--- a/ext/fg/js/client.js
+++ b/ext/fg/js/client.js
@@ -26,6 +26,7 @@ class Client {
         this.activateBtn  = 2;
         this.enabled      = false;
         this.options      = {};
+        this.results      = null;
         this.fgRoot       = chrome.extension.getURL('fg');
 
         chrome.runtime.onMessage.addListener(this.onBgMessage.bind(this));
@@ -107,7 +108,10 @@ class Client {
                 renderText(
                     {defs: results, root: this.fgRoot, options: this.options},
                     'term-list.html',
-                    (content) => this.showPopup(range, content)
+                    (content) => {
+                        this.results = results;
+                        this.showPopup(range, content, results);
+                    }
                 );
             }
         });
@@ -118,7 +122,10 @@ class Client {
             renderText(
                 {defs: results, root: this.fgRoot, options: this.options},
                 'kanji-list.html',
-                (content) => this.popup.setContent(content)
+                (content) => {
+                    this.results = results;
+                    this.popup.setContent(content, results);
+                }
             );
         });
     }
@@ -141,6 +148,7 @@ class Client {
         }
 
         this.lastRange = null;
+        this.results   = null;
     }
 
     setEnabled(enabled) {
-- 
cgit v1.2.3