From 7e2311085ce07838ff4137ae17d6fc306f8fcd17 Mon Sep 17 00:00:00 2001 From: Alex Hoyau Date: Sat, 2 Apr 2022 00:18:25 +0200 Subject: [PATCH] fixes in docs and comments --- CONTRIBUTING.md | 2 +- docs/api/block_manager.md | 2 +- src/utils/Droppable.js | 20 +++++++------------- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 060260c18..13a5ca196 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,7 @@ We welcome any type of contribution, not only code. Like for example: ## Your First Contribution -Working on your first Pull Request? You can learn how from this **free** series, [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github). +Working on your first Pull Request? You can learn how from this **free** series, [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github). ## Submitting code diff --git a/docs/api/block_manager.md b/docs/api/block_manager.md index 2d76d3275..d703db3fe 100644 --- a/docs/api/block_manager.md +++ b/docs/api/block_manager.md @@ -171,7 +171,7 @@ blockManager.render(); // Render new set of blocks const blocks = blockManager.getAll(); -const filtered = blocks.filter(block => block.get('category') == 'sections') +const filtered = blocks.filter(block => block.get('category').id == 'Sections') blockManager.render(filtered); // Or a new set from an array diff --git a/src/utils/Droppable.js b/src/utils/Droppable.js index 11b92a1f6..5f65b7095 100644 --- a/src/utils/Droppable.js +++ b/src/utils/Droppable.js @@ -17,13 +17,7 @@ export default class Droppable { const els = Array.isArray(el) ? el : [el]; this.el = el; this.counter = 0; - bindAll( - this, - 'handleDragEnter', - 'handleDragOver', - 'handleDrop', - 'handleDragLeave' - ); + bindAll(this, 'handleDragEnter', 'handleDragOver', 'handleDrop', 'handleDragLeave'); els.forEach(el => this.toggleEffects(el, 1)); return this; @@ -52,7 +46,7 @@ export default class Droppable { }, customTarget({ event }) { return doc.elementFromPoint(event.clientX, event.clientY); - } + }, } : null; method(frameEl, 'pointerenter', this.handleDragEnter); @@ -60,7 +54,7 @@ export default class Droppable { method(document, 'pointerup', this.handleDrop); method(frameEl, 'pointerout', this.handleDragLeave); - // Test with touche devices (seems like frameEl is not capturing pointer events). + // Test with touch devices (seems like frameEl is not capturing pointer events). // on/off(document, 'pointermove', sorter.onMove); // for the sorter // enable && this.handleDragEnter({}); // no way to use pointerenter/pointerout } @@ -123,7 +117,7 @@ export default class Droppable { } this.handleDragEnd(comp, dt); target.remove(); - } + }, }); dragStop = cancel => dragger.stop(ev, { cancel }); dragContent = cnt => (content = cnt); @@ -141,7 +135,7 @@ export default class Droppable { pfx: 'gjs-', onEndMove: model => this.handleDragEnd(model, dt), document: this.el.ownerDocument, - ...(this.sortOpts || {}) + ...(this.sortOpts || {}), }); sorter.setDropContent(content); sorter.startSort(); @@ -208,7 +202,7 @@ export default class Droppable { content.push({ type, file, - attributes: { alt: file.name } + attributes: { alt: file.name }, }); } } @@ -220,7 +214,7 @@ export default class Droppable { content = { type: 'link', attributes: { href: content }, - content: content + content: content, }; } else if (indexOf(types, 'text/json') >= 0) { const json = dt && dt.getData('text/json');