PHP Classes

File: modules/system/assets/ui/js/callout.js

Recommend this page to a friend!
  Packages of Luke Towers   Winter   modules/system/assets/ui/js/callout.js   Download  
File: modules/system/assets/ui/js/callout.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Winter
Content management system that uses MVC
Author: By
Last change:
Date: 7 months ago
Size: 1,982 bytes
 

Contents

Class file image Download
/* * Callout * * - Documentation: ../docs/callout.md */ +function ($) { 'use strict'; // CALLOUT CLASS DEFINITION // ====================== var dismiss = '[data-dismiss="callout"]' var Callout = function (el) { $(el).on('click', dismiss, this.close) } Callout.prototype.close = function (e) { var $this = $(this) var selector = $this.attr('data-target') if (!selector) { selector = $this.attr('href') selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } var $parent = $(selector) if (e) e.preventDefault() if (!$parent.length) { $parent = $this.hasClass('callout') ? $this : $this.parent() } $parent.trigger(e = $.Event('close.oc.callout')) if (e.isDefaultPrevented()) return $parent.removeClass('in') function removeElement() { $parent.trigger('closed.oc.callout').remove() } $.support.transition && $parent.hasClass('fade') ? $parent .one($.support.transition.end, removeElement) .emulateTransitionEnd(500) : removeElement() } // CALLOUT PLUGIN DEFINITION // ======================= var old = $.fn.callout $.fn.callout = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('oc.callout') if (!data) $this.data('oc.callout', (data = new Callout(this))) if (typeof option == 'string') data[option].call($this) }) } $.fn.callout.Constructor = Callout // CALLOUT NO CONFLICT // ================= $.fn.callout.noConflict = function () { $.fn.callout = old return this } // CALLOUT DATA-API // ============== $(document).on('click.oc.callout.data-api', dismiss, Callout.prototype.close) }(jQuery);