DmitrMakeev commited on
Commit
b17a8f2
·
verified ·
1 Parent(s): 81f0390

Update pages.html

Browse files
Files changed (1) hide show
  1. pages.html +13 -0
pages.html CHANGED
@@ -490,6 +490,7 @@ editor.Components.addType('custom-button', {
490
  `,
491
  // CSS-стили для кнопки
492
  style: `
 
493
  .atuin-btn {
494
  display: inline-flex;
495
  margin: 10px;
@@ -519,6 +520,7 @@ editor.Components.addType('custom-button', {
519
  outline-offset: 15px;
520
  color: #FFF;
521
  }
 
522
  `,
523
  // Скрипт для обработки нажатия кнопки и загрузки зависимостей
524
  script: function(props) {
@@ -598,6 +600,17 @@ editor.Components.addType('custom-button', {
598
  }
599
  ]
600
  }
 
 
 
 
 
 
 
 
 
 
 
601
  }
602
  });
603
  // Создаем блок для компонента кнопки
 
490
  `,
491
  // CSS-стили для кнопки
492
  style: `
493
+ <style>
494
  .atuin-btn {
495
  display: inline-flex;
496
  margin: 10px;
 
520
  outline-offset: 15px;
521
  color: #FFF;
522
  }
523
+ </style>
524
  `,
525
  // Скрипт для обработки нажатия кнопки и загрузки зависимостей
526
  script: function(props) {
 
600
  }
601
  ]
602
  }
603
+ },
604
+ // Добавляем обработчик для применения стилей
605
+ view: {
606
+ onRender({ el, model }) {
607
+ const style = model.get('style');
608
+ if (style) {
609
+ const styleElement = document.createElement('style');
610
+ styleElement.innerHTML = style;
611
+ document.head.appendChild(styleElement);
612
+ }
613
+ }
614
  }
615
  });
616
  // Создаем блок для компонента кнопки