{:uriI"file:///Library/WebServer/Documents/work/fine/_fae/app/assets/javascripts/fae/form/hinter.js?type=application/javascript&pipeline=self&id=08b82acf8b4c144080a7c94107b9836a5a01bfa659c1b5c2dd4e241c57795fc4:ET:load_pathI"G/Library/WebServer/Documents/work/fine/_fae/app/assets/javascripts;T: 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_inner'); //create the icon this.$icon = $('', { class: this.options.icon_class + ' ' + this.options.style_class }); 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"rails-env;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"%1 !|:*4@DvHÖ.P: lengthi :dependencies_digest"%{0*i>׌9Ugv~{:idI"E08b82acf8b4c144080a7c94107b9836a5a01bfa659c1b5c2dd4e241c57795fc4;F: mtimel+ĊX