1(function ($) { 2 Drupal.behaviors.theme = { 3 attach: function (context, settings) { 4 5 function all() { 6 //top menu height 7 function topMenuHeight() { 8 if ($(window).width() >= 769) { 9 $('.top-fix-menu').each(function () { 10 $(this).height(51); 11 $('.main-container').css('padding-bottom','51px'); 12 var mh = $(this).find('.menu'); 13 if (mh.find('li.dropdown').length == true) { 14 $(this).height(101); 15 $('.main-container').css('padding-bottom','101px'); 16 } 17 if (mh.find('li.dropdown').length == true && $('body').find('.manager-menu').length == true) { 18 $('.main-container').css('padding-bottom','136px'); 19 } 20 else if ($('body').find('.manager-menu').length == true) { 21 $('.main-container').css('padding-bottom','86px'); 22 } 23 }); 24 } 25 } 26 27 //left menu height 28 function leftMenuHeight() { 29 if ($(window).width() >= 769) { 30 $('.main-nav.navbar-collapse').each(function () { 31 var scrollId = $(this).height(); 32 //var scrollElement = $(this).find('.navbar-nav').height(); 33 var scrollWrap = $(this).find('nav'); 34 scrollWrap.height(scrollId - 66); 35 // if(scrollId < scrollElement){ 36 // scrollWrap.height(scrollId - 53); 37 // } 38 }); 39 } 40 41 if ($(window).width() >= 769) { 42 $('.main-nav > nav').mCustomScrollbar({ 43 axis: "y", 44 scrollButtons: {enable: true}, 45 scrollbarPosition: "outside", 46 mouseWheel: true, 47 advanced: { 48 autoExpandVerticalScroll: true 49 } 50 }); 51 } 52 } 53 topMenuHeight(); 54 leftMenuHeight(); 55 $(window).resize(function () { 56 leftMenuHeight(); 57 topMenuHeight() 58 }); 59 60 window.addEventListener("orientationchange", function() { 61 leftMenuHeight(); 62 topMenuHeight(); 63 }); 64 65 66 67 //select arrow position 68 function arrowPos(){ 69 $('.form-select').each(function () { 70 var sc_width = $(this).width(); 71 $(this).css('background-position-x', sc_width + 20 + 'px'); 72 }); 73 } 74 arrowPos(); 75 $(window).resize(function () { 76 arrowPos(); 77 }); 78 79 //search 80 $('.block-search .form-search', context).each( function() { 81 var open = $(this); 82 var special = $('.block-special-module'); 83 $(this).find('.input-group-btn').on('click', function () { 84 if (!open.hasClass('open')) { 85 open.addClass( 'open' ); 86 open.find('.form-text').focus(); 87 special.addClass('search-active'); 88 } else { 89 open.removeClass( 'open' ); 90 open.find('.form-text').blur(); 91 special.removeClass('search-active'); 92 } 93 }); 94 $(document).on('click', function(e) { 95 if (!$(e.target).closest(open.parent()).length) { 96 open.removeClass( 'open' ); 97 special.removeClass('search-active'); 98 } 99 e.stopPropagation(); 100 }); 101 102 }); 103 104 //organization visible org-view 105 $('.view-grouping .org-category').each( function() { 106 $(this).find('.views-row:gt(2)').hide(); 107 108 var items3 = $(this).find('.views-row:eq(2)'); 109 var itemsGt2 = $(this).find('.views-row:gt(2)'); 110 var items_all = $(this).find('.views-row'); 111 112 if (items_all > [4]) { 113 items3.after($('<div/>', { 114 'class': 'show-all', 115 text: 'ÐоÑмоÑÑеÑÑ Ð²Ñе', 116 click: function(){ 117 $(this).hide(); 118 //items_all.show(); 119 $(itemsGt2).each(function(i) { 120 $(this).delay((i++) * 250).fadeTo(500, 1); 121 }); 122 } 123 })); 124 } 125 }); 126 127 //images visible org-node 128 $('.field-name-field-photos .field-items').each( function() { 129 $(this).find('.field-item:gt(2)').hide(); 130 131 var items3 = $(this).find('.field-item:eq(2)'); 132 var itemsGt2 = $(this).find('.field-item:gt(2)'); 133 var items_all = $(this).find('.field-item'); 134 135 if (items_all > '3') { 136 137 items3.after($('<div/>', { 138 'class': 'field-item show-all', 139 text: 'ÐоÑмоÑÑеÑÑ Ð²Ñе', 140 click: function(){ 141 $(this).hide(); 142 //items_all.show(); 143 $(itemsGt2).each(function(i) { 144 $(this).delay((i++) * 250).fadeTo(500, 1); 145 }); 146 } 147 })); 148 } 149 150 }); 151 152 //fancybox files view
153 $('body:not(.page-node-edit) .file-download').each( function(){ 154 $('a.fancydoc').fancybox({ 155 type: "iframe", 156 'width':'80%', 157 'height':'100%' 158 }); 159 $(this).once( function(){ 160 var filename = $(this).find('.download-icon').attr('title'); 161 var filemime = filename.split('.'); 162 var lastItem = filemime[filemime.length - 1]; 163 $(this).find('span span').text(lastItem+', '); 164 }); 165 }); 166 $('.views-field-field-ldict-org-category').each(function () { 167 $('a.fancyvideo').fancybox({ 168 type: "iframe", 169 'width':'80%', 170 'height':'100%' 171 }); 172 $(this).find('.fancyvideo').text('Ðидео'); 173 }); 174 175 176 177 //add img-responsive class to img 178 $('.field-name-body').each(function(){ 179 $(this).find('img').addClass('img-responsive'); 180 }); 181 $('.panel-body').each(function(){ 182 $(this).find('img:not(.file-icon)').addClass('img-responsive'); 183 }); 184 } 185 186 187 if($('.view', context).ajaxComplete() || $(context).ajaxComplete()){ 188 all(); 189 } else all(); 190 191 $('.choices .form-type-radio label').each(function () { 192 var labelText = $(this).text(); 193 $(this).append('<div class="radio__text">'+labelText+'</div>'); 194 }); 195 // $('.yamaps-map-container').attr('data-map-behaviors','fullscreenControl,scrollZoom'); 196 // $(document).bind(function (event, map) { 197 // map.behaviors.disable('scrollZoom'); 198 // }); 199 // map.behavior.ScrollZoom().disable(); 200 201 202 } 203 }; 204}(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.