Commit 2e3a1582 authored by Leigh B Stoller's avatar Leigh B Stoller

Add text countdown for extend modal textarea.

parent 7ed19c20
......@@ -106,6 +106,20 @@ function (_, sup, moment, ShowImagingModal,
var win = window.open(url, '_blank');
win.focus();
});
// Setup the extend modal.
$('button#extend_button').click(function (event) {
event.preventDefault();
$('#why_extend').val('');
// Countdown characters needed for a good story.
$('#why_extend').on('focus keyup', function (e) {
var len = $('#why_extend').val().length;
var left = 120 - len;
var msg = "You need at least " + left + " more characters";
$('#extend_counter_msg').html(msg);
});
sup.ShowModal('#extend_modal');
});
// Handler for the Clone button.
$('button#clone_button').click(function (event) {
......
......@@ -31,7 +31,10 @@
</textarea>
</div>
</div>
<br>
<span style="font:normal 11px sans-serif;color:#B00400;">
<span id='extend_counter_msg'>&nbsp</span>
</span>
<br>
<button class='btn btn-primary btn-sm align-center'
id='request-extension'
type='submit' name='request'>Request Extension</button>
......
......@@ -65,8 +65,7 @@
Snapshot</button>
<% } %>
<button class='btn btn-xs btn-success' disabled
id='extend_button' type=button
data-toggle='modal' data-target='#extend_modal'>
id='extend_button' type=button>
Extend</button>
<button class='btn btn-xs btn-danger' disabled
id='terminate_button' type=button
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment