Skip to content

Commit

Permalink
Build
Browse files Browse the repository at this point in the history
  • Loading branch information
domchristie committed Nov 7, 2016
1 parent df1c34f commit ebbd46e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions dist/expanding.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ function Expanding (textarea) {
wrap(textarea, this.element)
this.element.appendChild(this.textareaClone.element)

var inputHandler = this.update.bind(this)
this.textarea.on(inputEvent, this.update.bind(this))
if (inputEvent !== 'input') this.textarea.on('paste', inputHandler)

this.update()
}

Expand Down Expand Up @@ -272,6 +275,9 @@ function setStyles () {

if (instance) {
switch (option) {
case 'update':
instance.update()
return
case 'destroy':
$this.removeData('expanding')
instance.destroy()
Expand Down
4 changes: 2 additions & 2 deletions dist/expanding.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ function Expanding (textarea) {
this.element.appendChild(this.textareaClone.element)

var inputHandler = this.update.bind(this)
this.textarea.on(inputEvent, inputHandler)
this.textarea.on('change', inputHandler)
this.textarea.on(inputEvent, this.update.bind(this))
if (inputEvent !== 'input') this.textarea.on('paste', inputHandler)

this.update()
}
Expand Down

0 comments on commit ebbd46e

Please sign in to comment.