How to use the @ephox/sugar.Compare.eq function in @ephox/sugar

To help you get started, we’ve selected a few @ephox/sugar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / header / StickyHeader.ts View on Github external
Focus.active(ownerDoc).filter((activeElm) => {
    // Don't try to refocus the same element
    return !Compare.eq(focusedElem, activeElm);
  }).filter((activeElm) => {
    // Only attempt to refocus if the current focus is the body or is in the header element
github tinymce / tinymce / modules / tinymce / src / plugins / table / main / ts / queries / TabContext.ts View on Github external
const isRoot = function (element) {
      const name = Node.name(element);
      return Compare.eq(element, body) || Arr.contains(rootElements, name);
    };
github tinymce / tinymce / modules / tinymce / src / core / main / ts / selection / SelectionBookmark.ts View on Github external
const isOrContains = function (root: Element, elm: Element) {
  return !NodeType.isRestrictedNode(elm.dom()) && (Compare.contains(root, elm) || Compare.eq(root, elm));
};
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / selector / TableSelectorHandles.ts View on Github external
  const isSameCell = (cellOpt: Option<element>, td: Element) =&gt; cellOpt.exists((currentTd) =&gt; Compare.eq(currentTd, td));
</element>
github tinymce / tinymce / modules / alloy / src / main / ts / ephox / alloy / behaviour / docking / ActiveDocking.ts View on Github external
dockInfo.contextual.each((contextInfo) => {
        if (Compare.eq(component.element(), simulatedEvent.event().target())) {
          Class.remove(component.element(), contextInfo.transitionClass);
          simulatedEvent.stop();
        }
      });
    }),
github tinymce / tinymce / modules / tinymce / src / themes / mobile / main / ts / ios / core / PlatformEditor.ts View on Github external
const isCollapsed = function (sel) {
      return Compare.eq(sel.start(), sel.finish()) && sel.soffset() === sel.foffset();
    };
github tinymce / tinymce / modules / tinymce / src / themes / mobile / main / ts / android / core / AndroidEvents.ts View on Github external
const isRanged = function (sel) {
    return !Compare.eq(sel.start(), sel.finish()) || sel.soffset() !== sel.foffset();
  };