|
161 | 161 | this.$textarea.css('resize',this.$options.resize); |
162 | 162 | } |
163 | 163 |
|
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 | + }); |
170 | 170 |
|
171 | 171 | if (this.eventSupported('keydown')) { |
172 | 172 | this.$textarea.on('keydown', $.proxy(this.keydown, this)); |
173 | 173 | } |
174 | 174 |
|
| 175 | + if (this.eventSupported('keypress')) { |
| 176 | + this.$textarea.on('keypress', $.proxy(this.keypress, this)) |
| 177 | + } |
| 178 | + |
175 | 179 | // Re-attach markdown data |
176 | 180 | this.$textarea.data('markdown',this); |
177 | 181 | } |
|
0 commit comments