Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-43370

Confirm dialog default width does not work well on mobile

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.6
    • FRONTEND
    • JavaScript
    • MOODLE_26_STABLE

    Description

      The default width for Moodle notification dialoguss is 400px, even on screens that are narrower than 400px. (Mobile phones have screens narrower than 400px, in portrait mode.)

      You can fix this in code that is providing the dialogue, such as the following, which looks pretty good:

              // Due to current Moodle limitation, the default size is incorrect n
              // devices with small screens.
              var winWidth = Y.one('body').get('winWidth');
              if (winWidth < 450) {
                  config.width = winWidth - 50;
              }
              var dialog = new M.core.confirm(config);
      

      I think it might be preferable if this behaviour were default - i.e. if no width is specified then rather than defaulting to 400, it should use (400px or 50px less than width of window, whichever is smaller).

      I'll stick a patch up for this. Not sure if it is a bug or improvement... The code is different for master/2.6 vs. 2.5 because stuff got moved around, so I'll just code it for master atm.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              quen Sam Marshall
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: