@internetstiftelsen/styleguide 2.21.11 → 2.21.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -137,7 +137,7 @@ function createToolbar(el, editor) {
137
137
  function getHTML(editor) {
138
138
  var html = editor.getHTML();
139
139
 
140
- return html.replace(/<li><p>/g, '<li>').replace(/<\/p><\/li>/g, '</li>');
140
+ return html;
141
141
  }
142
142
 
143
143
  function setupTextArea(el) {
@@ -158,6 +158,7 @@ function setupTextArea(el) {
158
158
  },
159
159
  onUpdate: function onUpdate(props) {
160
160
  var html = getHTML(props.editor);
161
+ console.log(html);
161
162
  el.value = html;
162
163
  onChange(html);
163
164
  }
@@ -218,7 +218,7 @@ function display() {
218
218
  * Dispatch the next modal in queue.
219
219
  */
220
220
  function dispatch() {
221
- if (active || !queue.length) {
221
+ if (!modal || active || !queue.length) {
222
222
  return;
223
223
  }
224
224
 
@@ -298,6 +298,10 @@ function createModal() {
298
298
  document.body.appendChild(modal);
299
299
 
300
300
  modalClose.addEventListener('click', close);
301
+
302
+ setTimeout(function () {
303
+ dispatch();
304
+ }, 1);
301
305
  }
302
306
 
303
307
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetstiftelsen/styleguide",
3
- "version": "2.21.11",
3
+ "version": "2.21.12",
4
4
  "main": "dist/components.js",
5
5
  "ports": {
6
6
  "fractal": "3000"
@@ -131,9 +131,7 @@ function createToolbar(el, editor) {
131
131
  function getHTML(editor) {
132
132
  const html = editor.getHTML();
133
133
 
134
- return html
135
- .replace(/<li><p>/g, '<li>')
136
- .replace(/<\/p><\/li>/g, '</li>');
134
+ return html;
137
135
  }
138
136
 
139
137
  export function setupTextArea(el, onChange = () => {}) {
@@ -155,6 +153,7 @@ export function setupTextArea(el, onChange = () => {}) {
155
153
  },
156
154
  onUpdate(props) {
157
155
  const html = getHTML(props.editor);
156
+ console.log(html);
158
157
  el.value = html;
159
158
  onChange(html);
160
159
  },
@@ -195,7 +195,7 @@ function display() {
195
195
  * Dispatch the next modal in queue.
196
196
  */
197
197
  function dispatch() {
198
- if (active || !queue.length) {
198
+ if (!modal || active || !queue.length) {
199
199
  return;
200
200
  }
201
201
 
@@ -286,6 +286,10 @@ function createModal() {
286
286
  document.body.appendChild(modal);
287
287
 
288
288
  modalClose.addEventListener('click', close);
289
+
290
+ setTimeout(() => {
291
+ dispatch();
292
+ }, 1);
289
293
  }
290
294
 
291
295
  /**
package/src/.DS_Store DELETED
Binary file
Binary file
Binary file
Binary file