Uploaded image for project: 'Reference Application'
  1. Reference Application
  2. RA-1673

Fix modal confirmations created using SimpleModal

    XMLWordPrintable

Details

    • Story
    • Status: Approved
    • TBD
    • Resolution: Fixed
    • None
    • None
    • None
    • Undetermined

    Description

       

      In UI Commons we have a (very old) emr.js library that provides a function to set up a confirmation dialog box.

      This function expects the "simplemodal" library to exist.  This library adds a new "modal" function to all jquery elements, so you can open something as a modal by calling:

      $jq('#selector').modal()

      However after the introduction of bootstrap this breaks.  It turns out that bootstrap.js also adds a new "modal" function to jquery elements, and (at least in some cases) overrides the one provided by simple modal.

      The "setupConfirmationDialog" method in emr.js expects to work with the simplemodal dialog, and so thereby doesn't work correctly when the boostrap "modal" function is called (specifically, it opens the modal, but the modal cannot be accessed).

      Long-term we should refactor the "setupConfirmationDialog" to use the bootstrap modal (see RA-1672) and remove the simple modal entirely.  But in the short-term, there appears to be a quick-fix we can try... simplemodal also provides a "modal" function directly on the main jquery object.  This doesn't seem to be overridden by bootstrap, so if we use that method to set up the modal, things appear to work.

       

       

       

      Gliffy Diagrams

        Attachments

          Activity

            People

              mozzy Moses Mutesasira
              mogoodrich Mark Goodrich
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: