Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-1067

Redundant bootstrap reference in Main layout template causes an issue with swagger

    XMLWordPrintable

Details

    • 3
    • +
    • Hide

      1. Open the documentation page of a standard developer portal on a mobile device
      2. Click the menu button.
      3. Observe menu opens fully and immediately collapses

      Show
      1. Open the documentation page of a standard developer portal on a mobile device 2. Click the menu button. 3. Observe menu opens fully and immediately collapses
    • 3scale 2019-04-23, 3scale 2019-05-06, 3scale 2019-05-20

    Description

      On android / google chrome (see this comment and Steps to Reproduce.)

      When viewing the active docs section of the developer portal on a mobile device the menu button does not work correctly. It will open fully and immediately collapse on each click. After some debugging I was able to determine that this is caused by a conflict between multiple versions of bootstrap and jquery on the page.

      In the default Main layout template there are two references to bootstrap included.

      One in the head that looks like this:

      {{ '/javascripts/bootstrap.min.js' | javascript_include_tag }}

      And one at the bottom that looks like this:

      <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>

      It would seem that there is some conflict between these two versions of bootstrap (even though they claim to be the same version 3.0.0, they are not) and it only presents an issue when swagger UI is introduced. There really shouldn't be two in either case. I was able to resolve the issue by removing the one that is in the head.

      I attempted to replace the CDN version with the one hosted in the local javascripts folder but it did not function correctly so care must be taken to ensure that there is only one version of bootstrap on the page and if we decide to use one hosted in javascripts it should be verified to be the correct version and working correctly.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rhn-support-spoole Shannon Poole
            Jakub Smolár Jakub Smolár
            Didier Di Cesare Didier Di Cesare (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: