diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-07-24 18:41:15 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-07-24 18:41:15 +0200 |
| commit | 28553fe863564b44f810eacc0ce3f45608346297 (patch) | |
| tree | 057febb8a68355257048ebb1eae5b5a44b2b6341 /StoneIsland/platforms/ios/www/js/lib/blogs/PageView.js | |
| parent | b6774fedca6a535e9f863d4bb72d87f46c47a59b (diff) | |
build the thing....
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/blogs/PageView.js')
| -rwxr-xr-x | StoneIsland/platforms/ios/www/js/lib/blogs/PageView.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/PageView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/PageView.js index f5f8ab2e..ae18091a 100755 --- a/StoneIsland/platforms/ios/www/js/lib/blogs/PageView.js +++ b/StoneIsland/platforms/ios/www/js/lib/blogs/PageView.js @@ -22,10 +22,11 @@ var PageView = ScrollableView.extend({ this.$content.html(data.body.replace(/\n/g, "<br>")) this.$content.find("a").each(function(){ var href = $(this).attr("href") // .substr(1, "fuck".length-2) - if (href.indexOf("“")) { + if (href.indexOf("“") !== -1) { href = href.substr(1, href.length-2) $(this).attr("href", href) } + console.log(href) $(this).attr("target", "_system") }) }, @@ -35,7 +36,11 @@ var PageView = ScrollableView.extend({ e.preventDefault() var href = $(e.currentTarget).attr("href") console.log(href) - window.open(href, '_system') + if (href.indexOf('http') !== 0) { + app.router.go(href.replace('!/', '')) + } else { + window.open(href, '_system') + } }, })
\ No newline at end of file |
