diff options
author | Allan Wang <me@allanwang.ca> | 2019-02-05 23:02:50 -0500 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-02-05 23:02:50 -0500 |
commit | ddfc310fde5f50ba52ef930287449c2e08faaca8 (patch) | |
tree | d96d38769b841f55e493a84805b99a294d7bc0ac /app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt | |
parent | 8b850711ceb7c38f9368ce840831c1c0bdb4ba74 (diff) | |
download | frost-ddfc310fde5f50ba52ef930287449c2e08faaca8.tar.gz frost-ddfc310fde5f50ba52ef930287449c2e08faaca8.tar.bz2 frost-ddfc310fde5f50ba52ef930287449c2e08faaca8.zip |
Add ability to copy comments, resolves #454
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt index 19d16e87..50a5e2e1 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt @@ -76,10 +76,9 @@ class FrostJSI(val web: FrostWebView) { } @JavascriptInterface - fun contextMenu(url: String, text: String?) { - if (!text.isIndependent) return + fun contextMenu(url: String?, text: String?) { //url will be formatted through webcontext - web.post { context.showWebContextMenu(WebContext(url, text)) } + web.post { context.showWebContextMenu(WebContext(url.takeIf { it.isIndependent }, text)) } } /** |