Skip to content

Commit 9198e97

Browse files
committed
Merge pull request #218 from acrobat/events_fix
Fixed events config
2 parents 923a1ba + a898177 commit 9198e97

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

js/bootstrap-markdown.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,21 @@
161161
this.$textarea.css('resize',this.$options.resize);
162162
}
163163

164-
this.$textarea
165-
.on('focus', $.proxy(this.focus, this))
166-
.on('keypress', $.proxy(this.keypress, this))
167-
.on('keyup', $.proxy(this.keyup, this))
168-
.on('change', $.proxy(this.change, this))
169-
.on('select', $.proxy(this.select, this));
164+
this.$textarea.on({
165+
'focus' : $.proxy(this.focus, this),
166+
'keyup' : $.proxy(this.keyup, this),
167+
'change' : $.proxy(this.change, this),
168+
'select' : $.proxy(this.select, this)
169+
});
170170

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

175+
if (this.eventSupported('keypress')) {
176+
this.$textarea.on('keypress', $.proxy(this.keypress, this))
177+
}
178+
175179
// Re-attach markdown data
176180
this.$textarea.data('markdown',this);
177181
}

0 commit comments

Comments
 (0)