PageSourceSearch

https://city26.ru/js/dropdown.js

js city26.ru collected 2026-10-04 22:53:27 UTC 1,244 bytes, 20 lines download raw bytes

1!function($){"use strict";var toggle='[data-toggle="dropdown"]',Dropdown=function(element){var $el=$(element).on('click.dropdown.data-api',this.toggle)
2$('html').on('click.dropdown.data-api',function(){$el.parent().removeClass('open')})}
3Dropdown.prototype={constructor:Dropdown,toggle:function(e){var $this=$(this),$parent,selector,isActive
4if($this.is('.disabled, :disabled'))return
5selector=$this.attr('data-target')
6if(!selector){selector=$this.attr('href')
7selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
8$parent=$(selector)
9$parent.length||($parent=$this.parent())
10isActive=$parent.hasClass('open')
11clearMenus()
12if(!isActive)$parent.toggleClass('open')
13return false}}
14function clearMenus(){$(toggle).parent().removeClass('open')}
15$.fn.dropdown=function(option){return this.each(function(){var $this=$(this),data=$this.data('dropdown')
16if(!data)$this.data('dropdown',(data=new Dropdown(this)))
17if(typeof option=='string')data[option].call($this)})}
18$.fn.dropdown.Constructor=Dropdown
19$(function(){$('html').on('click.dropdown.data-api',clearMenus)
20$('body').on('click.dropdown','.dropdown form',function(e){e.stopPropagation()}).on('click.dropdown.data-api',toggle,Dropdown.prototype.toggle)})}(window.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.