Skip to content

Commit

Permalink
Fixed events config. Closes #215
Browse files Browse the repository at this point in the history
  • Loading branch information
acrobat committed Jan 15, 2016
1 parent 923a1ba commit a898177
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions js/bootstrap-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,21 @@
this.$textarea.css('resize',this.$options.resize);
}

this.$textarea
.on('focus', $.proxy(this.focus, this))
.on('keypress', $.proxy(this.keypress, this))
.on('keyup', $.proxy(this.keyup, this))
.on('change', $.proxy(this.change, this))
.on('select', $.proxy(this.select, this));
this.$textarea.on({
'focus' : $.proxy(this.focus, this),
'keyup' : $.proxy(this.keyup, this),
'change' : $.proxy(this.change, this),
'select' : $.proxy(this.select, this)
});

if (this.eventSupported('keydown')) {
this.$textarea.on('keydown', $.proxy(this.keydown, this));
}

if (this.eventSupported('keypress')) {
this.$textarea.on('keypress', $.proxy(this.keypress, this))
}

// Re-attach markdown data
this.$textarea.data('markdown',this);
}
Expand Down

0 comments on commit a898177

Please sign in to comment.