| 396 | } | 396 | } |
| 397 | | 397 | |
| 398 | //show AN if it's hidden | 398 | //show AN if it's hidden |
| 399 | if ($('#floatingPrompt').css('display') !== 'flex') { | 399 | const $ANcontainer = $('#floatingPrompt'); |
| 400 | $('#floatingPrompt').addClass('resizing'); | 400 | if ($ANcontainer.css('display') !== 'flex') { |
| 401 | $('#floatingPrompt').css('display', 'flex'); | 401 | $ANcontainer.addClass('resizing'); |
| 402 | $('#floatingPrompt').css('opacity', 0.0); | 402 | $ANcontainer.css('display', 'flex'); |
| 403 | $('#floatingPrompt').transition({ | 403 | $ANcontainer.css('opacity', 0.0); |
| | 404 | $ANcontainer.transition({ |
| | 405 | height: 'unset', //AN gets height: 0 from CSS LN 5363 for .drawer-content |
| 404 | opacity: 1.0, | 406 | opacity: 1.0, |
| 405 | duration: animation_duration, | 407 | duration: animation_duration, |
| 406 | }, async function () { | 408 | }, async function () { |
| 407 | await delay(50); | 409 | await delay(50); |
| 408 | $('#floatingPrompt').removeClass('resizing'); | 410 | $ANcontainer.removeClass('resizing'); |
| 409 | }); | 411 | }); |
| 410 | | 412 | |
| 411 | //auto-open the main AN inline drawer | 413 | //auto-open the main AN inline drawer |
| 412 | if ($('#ANBlockToggle') | 414 | if ($('#ANBlockToggle') |
| 413 | .siblings('.inline-drawer-content') | 415 | .siblings('.inline-drawer-content') |
| 414 | .css('display') !== 'block') { | 416 | .css('display') !== 'block') { |
| 415 | $('#floatingPrompt').addClass('resizing'); | 417 | $ANcontainer.addClass('resizing'); |
| 416 | $('#ANBlockToggle').click(); | 418 | $('#ANBlockToggle').trigger('click'); |
| 417 | } | 419 | } |
| 418 | } else { | 420 | } else { |
| 419 | //hide AN if it's already displayed | 421 | //hide AN if it's already displayed |
| 420 | $('#floatingPrompt').addClass('resizing'); | 422 | $ANcontainer.addClass('resizing'); |
| 421 | $('#floatingPrompt').transition({ | 423 | $ANcontainer.transition({ |
| 422 | opacity: 0.0, | 424 | opacity: 0.0, |
| 423 | duration: animation_duration, | 425 | duration: animation_duration, |
| 424 | }, async function () { | 426 | }, async function () { |
| 425 | await delay(50); | 427 | await delay(50); |
| 426 | $('#floatingPrompt').removeClass('resizing'); | 428 | $ANcontainer.removeClass('resizing'); |
| 427 | }); | 429 | }); |
| 428 | setTimeout(function () { | 430 | setTimeout(function () { |
| 429 | $('#floatingPrompt').hide(); | 431 | $ANcontainer.hide(); |
| 430 | }, animation_duration); | 432 | }, animation_duration); |
| 431 | } | 433 | } |
| 432 | | 434 | |