You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
685 B

3 years ago
  1. import Component from '@ember/component';
  2. import { scheduleOnce } from "@ember/runloop";
  3. export default Component.extend({
  4. classNames: 'category-name-header',
  5. didInsertElement() {
  6. scheduleOnce('afterRender', () => {
  7. let $el = $(this.element);
  8. if (this.category.uploaded_logo) {
  9. $el.insertAfter('section.category-heading .category-logo');
  10. $('section.category-heading').addClass('has-logo');
  11. $('section.category-heading .category-name-header, section.category-heading p').wrapAll('<div class="category-heading-details"></div>');
  12. } else {
  13. $el.appendTo('section.category-heading');
  14. }
  15. });
  16. }
  17. })