Sha256: ef0d4031cb7c966c7b781c1ed9e39617c75f4e1418ec20d2aac13663a4382139

Contents?: true

Size: 1.07 KB

Versions: 81

Compression:

Stored size: 1.07 KB

Contents

// Util: PatternFly Popovers
// Add data-close="true" to insert close X icon
(function ($) {
  'use strict';

  $.fn.popovers = function () {
    // Initialize
    this.popover();

    // Add close icons
    this.filter('[data-close=true]').each(function (index, element) {
      var $this = $(element),
        title = $this.attr('data-original-title') + '<button type="button" class="close" aria-hidden="true"><span class="pficon pficon-close"></span></button>';

      $this.attr('data-original-title', title);
    });

    // Bind Close Icon to Toggle Display
    this.on('click', function (e) {
      var $this = $(this),
        $title = $this.next('.popover').find('.popover-title');

      // Only if data-close is true add class "x" to title for right padding
      $title.find('.close').parent('.popover-title').addClass('closable');

      // Bind x icon to close popover
      $title.find('.close').on('click', function () {
        $this.popover('hide');
      });

      // Prevent href="#" page scroll to top
      e.preventDefault();
    });

    return this;
  };
}(jQuery));

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
patternfly-sass-3.59.5 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.59.4 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.59.3 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.59.2 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.59.1 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.59.0 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.58.0 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.57.2 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.57.1 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.57.0 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.56.0 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.55.0 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.54.8 dist/js/patternfly-functions-popovers.js
patternfly-sass-0.0.0.pre.semantically.pre.released dist/js/patternfly-functions-popovers.js
patternfly-sass-3.54.2 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.54.3 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.54.1 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.54.0 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.53.1 dist/js/patternfly-functions-popovers.js
patternfly-sass-3.53.0 dist/js/patternfly-functions-popovers.js