DmitrMakeev commited on
Commit
7ac5495
·
verified ·
1 Parent(s): 9d8faa7

Update pages.html

Browse files
Files changed (1) hide show
  1. pages.html +36 -0
pages.html CHANGED
@@ -570,6 +570,42 @@ editor.DomComponents.addType('form-button', {
570
  },
571
  },
572
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
573
  // Добавление кнопки для открытия редактора кода
574
  const pn = editor.Panels;
575
  const panelViews = pn.addPanel({
 
570
  },
571
  },
572
  });
573
+
574
+ // Добавляем возможность настройки ссылки "Политика конфиденциальности"
575
+ editor.DomComponents.addType('privacy-policy-link', {
576
+ model: {
577
+ defaults: {
578
+ traits: [
579
+ {
580
+ type: 'text',
581
+ name: 'href',
582
+ label: 'Link URL',
583
+ },
584
+ {
585
+ type: 'checkbox',
586
+ name: 'newWindow',
587
+ label: 'Open in new window',
588
+ },
589
+ ],
590
+ },
591
+ },
592
+ });
593
+
594
+ // JavaScript для обработки изменений в настройках
595
+ editor.on('component:update', function(component) {
596
+ if (component.get('type') === 'privacy-policy-link') {
597
+ const href = component.get('attributes').href;
598
+ const newWindow = component.get('attributes').newWindow;
599
+ const link = document.getElementById('privacyPolicyLink');
600
+ link.href = href;
601
+ link.target = newWindow ? '_blank' : '_self';
602
+ }
603
+ });
604
+
605
+
606
+
607
+
608
+
609
  // Добавление кнопки для открытия редактора кода
610
  const pn = editor.Panels;
611
  const panelViews = pn.addPanel({