Browse Source

fixes in docs and comments

pull/4232/head
Alex Hoyau 4 years ago
parent
commit
7e2311085c
  1. 2
      CONTRIBUTING.md
  2. 2
      docs/api/block_manager.md
  3. 20
      src/utils/Droppable.js

2
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

2
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

20
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');

Loading…
Cancel
Save