Skip to content

Commit

Permalink
Remove unnecessary check for count message
Browse files Browse the repository at this point in the history
Count message markup is now required so this check is not necessary.
  • Loading branch information
hannalaakso committed Oct 2, 2019
1 parent 0bb980c commit 1e914d0
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/govuk/components/character-count/character-count.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,16 @@ CharacterCount.prototype.init = function () {
return
}

// Remove hard limit if set
$module.removeAttribute('maxlength')

// If there's a maximum length defined and the count message exists
if (this.countMessage) {
// Remove hard limit if set
$module.removeAttribute('maxlength')
// Bind event changes to the textarea
var boundChangeEvents = this.bindChangeEvents.bind(this)
boundChangeEvents()

// Bind event changes to the textarea
var boundChangeEvents = this.bindChangeEvents.bind(this)
boundChangeEvents()

// Update count message
var boundUpdateCountMessage = this.updateCountMessage.bind(this)
boundUpdateCountMessage()
}
// Update count message
var boundUpdateCountMessage = this.updateCountMessage.bind(this)
boundUpdateCountMessage()
}

// Read data attributes
Expand Down

0 comments on commit 1e914d0

Please sign in to comment.