Skip to content
This repository was archived by the owner on Jun 9, 2023. It is now read-only.
This repository was archived by the owner on Jun 9, 2023. It is now read-only.

Cloning the DOM is affects perfomance #16

@FortuneN

Description

@FortuneN

First of all, i would like to say i love your modal and have used it a couple of times already. If it's not a problem, i would like to suggest what i think is an improvement (i hope you agree).

My scenario involves a few drop-down/select lists in the DOM and the clone + insert process is resulting in a noticeable pause.

I was wondering if you would consider an option that involves only making the 'target' (and 'pgwModalBackdrop') visible.

This would work very well with angular (and other context-binding frameworks) and maybe even remove the need for just-in-time 'angularCompilation()'.

The solution would involve something similar to bootstrap modals (http://getbootstrap.com/javascript/#modals) i.e.the developer adds the HTML surrounding the modal content into the page before run-time (as shown below).

<div id="myPgwModal">
  <div class="pm-container">
    <div class="pm-body">
        <span class="pm-close"></span>
        <div class="pm-title">
          MY TITLE
        </div>
        <div class="pm-content">
          MY CONTENT
      </div>
    </div>
  </div>
</div>

The rest of the code remains the same and then code simply references that HTML (instead of dynamic insertion). Ofcoz the current behavior would remain; i appreciate the simplicity and how it makes getting started easier.

If you are willing to consider this, i am willing to work on it with you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions