MCPcopy Index your code
hub / github.com/shipshapecode/tether / _getAllClasses

Function _getAllClasses

src/js/constraint.js:276–296  ·  view source on GitHub ↗

* Get all the initial classes * @param classes * @param {string} classPrefix * @param constraints * @return {[*, *]} * @private

(classes, classPrefix, constraints)

Source from the content-addressed store, hash-verified

274 * @private
275 */
276function _getAllClasses(classes, classPrefix, constraints) {
277 const allClasses = [getClass('pinned', classes, classPrefix), getClass('out-of-bounds', classes, classPrefix)];
278
279 constraints.forEach((constraint) => {
280 const { outOfBoundsClass, pinnedClass } = constraint;
281 if (outOfBoundsClass) {
282 allClasses.push(outOfBoundsClass);
283 }
284 if (pinnedClass) {
285 allClasses.push(pinnedClass);
286 }
287 });
288
289 allClasses.forEach((cls) => {
290 ['left', 'top', 'right', 'bottom'].forEach((side) => {
291 allClasses.push(`${cls}-${side}`);
292 });
293 });
294
295 return allClasses;
296}
297
298export default {
299 position({ top, left, targetAttachment }) {

Callers 2

constraint.spec.jsFile · 0.85
positionFunction · 0.85

Calls 1

getClassFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…