Fixes the proposal abstract word count javascript functions

fix #510
This commit is contained in:
Chrisbr 2014-10-05 18:58:47 +02:00
parent 9e499d2a5e
commit c995f57877
3 changed files with 23 additions and 32 deletions

View file

@ -173,6 +173,24 @@ function word_count(text, divId, maxcount) {
}
};
/* Set the minimum and maximum proposal abstract word length */
$("#event_event_type_id").change(function () {
var $selected = $("#event_event_type_id option:selected")
var max = $selected.data("max-words");
var min = $selected.data("min-words");
$("#abstract-maximum-word-count").text(max);
$("#abstract-minimum-word-count").text(min);
word_count($('#event_abstract').get(0), 'abstract-count', max);
})
.trigger('change');
/* Count the proposal abstract length */
$("#event_abstract").bind('keyup', function() {
var $selected = $("#event_event_type_id option:selected")
var max = $selected.data("max-words");
word_count(this, 'abstract-count', max);
} );
/* Set the defaults for DataTables initialisation */
$.extend( true, $.fn.dataTable.defaults, {