{:uriI"file:///Library/WebServer/Documents/work/fine/_fae/app/assets/javascripts/fae/form/hinter.js?type=application/javascript&pipeline=self&id=303148dcd4dc015485656bc01516e25f7e9190deac6afd5961a5f79586b6e0f7:ET:load_pathI"G/Library/WebServer/Documents/work/fine/_fae/app/assets/javascripts;F: filenameI"Z/Library/WebServer/Documents/work/fine/_fae/app/assets/javascripts/fae/form/hinter.js;T: nameI"fae/form/hinter;T:logical_pathI"fae/form/hinter.self.js;T:content_typeI"application/javascript;T: sourceI" /* global FCH */ (function ( $ ) { 'use strict'; /** * Display inline modal of helper text. This is the bread and butter of the plugin. * @private * @param {jQuery} $el - The object to display the text relative to */ function showModal($el) { var top = $el.offset().top - FCH.$window.scrollTop(); var left = $el.offset().left + 20; var $hint = $el.closest('label').siblings('.hint'); var new_height = $hint.height() + 80; var width = 250; if ($hint.find('.youtube-hint').length) { width = 570; new_height -= 40; } $hint.modal({ minHeight: new_height, minWidth: width, maxWidth: width, position: [top, left], overlayClose: true, opacity: 0, containerCss: { position: 'absolute' } }); } /** * Private initialization of Hinter object. * @class */ function Hinter($el, options) { /** Inherited settings from jQuery initialization */ this.options = options; this._drawElements($el); this._clickListener(); // this._hoverListener(); return this } /** * Create jQuery object of the $icon and add it to the DOM * @protected */ Hinter.prototype._drawElements = function($el) { var $label = $el.parent().find('label'); var $h6 = $label.find('h6'); //create the icon this.$icon = $('', { class: this.options.icon_class + ' ' + this.options.style_class }); // so if there's an h6 description then insert it before // if not, then append to the end of the label if ($h6.length) { this.$icon.insertBefore($h6); } else { this.$icon.appendTo($label); } }; /** * Show the modal on click * @protected */ Hinter.prototype._clickListener = function() { this.$icon.click(function(){ showModal( $(this) ); }); }; /** * Allow hover to do the same as a clicking */ Hinter.prototype._hoverListener = function(){ var $clicker = $('.hinter-clicker'); this.$icon.mouseenter(function() { $clicker.addClass('hovered'); showModal( $(this) ); }); this.$icon.mouseleave(function() { $clicker.removeClass('hovered'); $.modal.close(); }); }; /** * Display helper text in a very small inline modal * @function external:'jQuery.fn'.hinter */ $.fn.hinter = function( options ) { var defaults = { icon_class: 'icon-support', style_class: 'hinter-clicker' }; // unite the default options with the passed-in ones var settings = $.extend( {}, defaults, options ); return this.each(function() { var hint = new Hinter($(this), settings); }); }; }( jQuery )); ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"hfile-digest:///Library/WebServer/Documents/work/fine/_fae/app/assets/javascripts/fae/form/hinter.js;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%.=v8ZabW0{(W% f: lengthi :integrityI"Xni:///sha-256;zC6Gw-Y9dpu-pKc4E1phYleoMHsoqlee4cElDAtmsAg?ct=application/javascript;T:dependencies_digest"%xdbAe95xL/Yc:idI"E303148dcd4dc015485656bc01516e25f7e9190deac6afd5961a5f79586b6e0f7;F: mtimel+ܗX