Skip to content

Commit

Permalink
enable in page scroll for footnotes (#148, #157)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmfrnz committed Apr 18, 2017
1 parent 44de0d9 commit 1f5afcd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app/components/app/page/PageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ define([

var PageView = Backbone.View.extend({
events : {
"click .close-page" : "closePage"
"click .close-page" : "closePage",
"click a" : "pageLink",
},
initialize : function () {
this.render()
Expand Down Expand Up @@ -65,7 +66,16 @@ define([
this.$el.hide()
}
},

pageLink: function(e) {
if($(e.target).attr('href').startsWith('#')) {
e.preventDefault()
this.$el.trigger('navLink', {
route:'page',
id: this.model.get('pageId'),
anchor: $(e.target).attr('href').substring(1)
})
}
},
closePage : function(e){
e.preventDefault()

Expand Down

0 comments on commit 1f5afcd

Please sign in to comment.