Skip to content

Splitting up Uize.Node #37

@BenAtZazzle

Description

@BenAtZazzle

Not sure if this is the best place to talk about this, or if a .todo file would be better, but we've been discussing splitting up Uize.Node into multiple files in order to reduce the amount of code Uize.Widget needs. Uize.Node would become an aggregator method in the same way Uize.String has become one for backwards compatibility.

Here's my proposal (names are still TBD):

Uize.Dom - new namespace (like Uize.Str)

Uize.Dom.Common - essentially the commonly-used methods (majority of which Uize.Widget needs)

methods:

  • display
  • doForAll
  • find
  • getById
  • getInnerHtml (doesn't exist, but seems like it should for parity)
  • getStyle
  • getValue
  • injectHtml
  • isNode
  • isOnNodeTree (used by find and other methods)
  • joinIdPrefixAndNodeId
  • remove
  • setClipRect (there is a setNodeClipRect method which is only used by 3 widgets, so not sure of its worth)
  • setInnerHtml
  • setOpacity
  • setProperties
  • setStyle
  • setValue
  • show
  • unwire
  • unwireEventsByOwnerId (used by unwire)
  • wire

static properties:

  • ieMajorVersion
  • isIe
  • isMozilla
  • isSafari

methods that aren't used by Uize.Widget but don't have a home:

  • getDocumentScrollElement
  • getText
  • showClickable

Uize.Dom.Pos - essentially the positioning stuff

  • centerInWindow
  • getCoords
  • getDimensions
  • getEventAbsPos
  • setAbsPos
  • setAbsPosAdjacentTo
  • setCoords

Added to Uize.Math.LogicalPos

  • doRectanglesOverlap

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions