Skip to content

Commit

Permalink
JS check on textarea maxlength attribute is not essential
Browse files Browse the repository at this point in the history
  • Loading branch information
Pictor13 committed Aug 29, 2016
1 parent d20f035 commit 9d98c17
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions app/modules/Honeybee_Core/assets/ui/Autostart.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ define([
config.get('widgets.loading_release_time', 10000)
);
handleClipboardCopyClicks();
handleTextareaMaxlength();

// "data-clipboard-copy-value" text will be copied to clipboard from ".js-clipboard-copy" elements on click
function handleClipboardCopyClicks() {
Expand Down Expand Up @@ -148,16 +147,4 @@ define([
}
});
}

function handleTextareaMaxlength() {
$('textarea[maxlength]').on('input propertychange', function(event) {
$textarea = $(this);
maxlength = $textarea.attr('maxlength');
if (isNaN(maxlength) || maxlength < 0) {
return;
}
limited_content = $textarea.val().substr(0, maxlength);
$textarea.val(limited_content);
});
}
});

0 comments on commit 9d98c17

Please sign in to comment.