1(function($) { 2 $.fn.FlowupLabels = function( options ){ 3 4 var defaults = { 5 // Useful if you pre-fill input fields or if localstorage/sessionstorage is used. 6 feature_onLoadInit: true, 7 // Class names used for focus and populated statuses 8 class_focused: 'focused', 9 class_populated: 'populated' 10 }, 11 settings = $.extend({}, defaults, options); 12 13 14 return this.each(function(){ 15 var $scope = $(this); 16 17 $scope.on('focus.flowupLabelsEvt', '.fl_input', function() { 18 $(this).closest('.fl_wrap').addClass(settings.class_focused); 19 }) 20 .on('blur.flowupLabelsEvt', '.fl_input', function() { 21 var $this = $(this); 22 console.log($this.val()) 23 if ($this.val().length) { 24 $this.closest('.fl_wrap') 25 .addClass(settings.class_populated) 26 .removeClass(settings.class_focused); 27 } 28 else { 29 console.log($this.val()) 30 $this.closest('.fl_wrap').not( $('select').closest('.fl_wrap') ) 31 .removeClass(settings.class_populated + ' ' + settings.class_focused); 32 } 33 }); 34 35 36 // On page load, make sure it looks good 37 if (settings.feature_onLoadInit) { 38 $scope.find('.fl_input').trigger('blur.flowupLabelsEvt'); 39 } 40 }); 41 }; 42})( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.