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

Cloning the DOM is affects perfomance #16

Open
FortuneN opened this issue Nov 9, 2014 · 0 comments
Open

Cloning the DOM is affects perfomance #16

FortuneN opened this issue Nov 9, 2014 · 0 comments

Comments

@FortuneN
Copy link

FortuneN commented Nov 9, 2014

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant