mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
28 lines
1.0 KiB
JavaScript
28 lines
1.0 KiB
JavaScript
$(document).ready(function () {
|
|
$('.content-field').find('textarea').focus(function (focus_event) {
|
|
var focused_text_field = $(focus_event.target);
|
|
var parent_content_field = focused_text_field.closest('.content-field');
|
|
|
|
$('.show-when-focused').hide();
|
|
parent_content_field.find('.show-when-focused').show();
|
|
|
|
$('.content-field').removeClass('focused');
|
|
parent_content_field.addClass('focused');
|
|
});
|
|
|
|
// um sir excuse me why does this need to be in a setTimeout? It doesn't work
|
|
// unless it is... for whatever reason. Here be dragons.
|
|
setTimeout(function () {
|
|
$('.content-field').find('.chips input').focus(function (focus_event) {
|
|
var focused_text_field = $(focus_event.target);
|
|
var parent_content_field = focused_text_field.closest('.content-field');
|
|
|
|
$('.show-when-focused').hide();
|
|
parent_content_field.find('.show-when-focused').show();
|
|
|
|
$('.content-field').removeClass('focused');
|
|
parent_content_field.addClass('focused');
|
|
});
|
|
}, 100);
|
|
});
|