Orange-OpenSource / Orange-Boosted-Bootstrap

Orange Boosted is an accessible, ergonomic and Orange branded framework based on Bootstrap
https://boosted.orange.com/
MIT License
193 stars 56 forks source link

ODS > Popovers #607

Open ffoodd opened 3 years ago

ffoodd commented 3 years ago

Requirement

For a Developer Who is creating an Orange Website The Popover Integration is an automated component that proposes the web site's Orange Popover Helpers unlike the default bootstrap framework Boosted will provide this ready to use component compatible with the Orange Design and the accessibility requirements

Description

References

ffoodd commented 3 years ago

As a reference, I already implemented this years ago using Boosted v4 and jQuery.

The pattern simple required:

Example

$(document).ready(function() {
  $('.btn-modal').on('click', function() {
    var $modal  = $(this).parents('[role="dialog"]');
    var $target = $(this).data('target');
    var $highlights = $(".highlight");

    $highlights.removeClass("highlight");

    $modal.modal('hide');

    $modal.on('hidden.bs.modal', function() {
      $highlights.removeClass("highlight");
      $($target).modal('show');
      $target = null;
    });
  });

  $('[role="dialog"][id$="-step"]').on('shown.bs.modal', function() {
    var $related = $(this).data('related').split(',');
    var $coords  = $("#" + $related[0]).offset();

    $.each( $related, function(index, value) {
      $("#" + value).addClass("highlight");
    });

    $('html, body').animate({
      scrollTop: $coords.top - 108
    }, 500);

    $related = null;
    $coords = null;
  });
});

It also required a few tricks template-side for first and last modals (e.g. "Done" button for the last slide, "Let'sgo" button on the first one).

ffoodd commented 3 years ago

Regarding "Guided Tour", just came across a Bootstrap unofficial plugin that just does that (only working with v4 AFAIK): Bootstrap Tour. It seems unmaintained but could still be an inspiration of some sort.

julien-deramond commented 1 year ago

A prototype has been done for the Popover Tour at https://github.com/Orange-OpenSource/Orange-Boosted-Bootstrap/pull/2190. Let's go back from it when we'll tackle this feature.