1;(function($, window, document, undefined){ 2 3 // Defaults state 4 var State = { 5 visible : "is-visible", 6 hidden : "is-hidden", 7 active : "is-active", 8 open : "is-open", 9 close : "is-close", 10 dropdown : "is-dropdown", 11 completed : "is-completed" 12 } 13 14 // Defaults element 15 var Elements = { 16 body : $("body, html"), 17 appOverlay : $(".app-overlay") 18 } 19 20 // Initialize 21 function _init(){ 22 dealersFilter(); 23 } 24 25 function dealersFilter() { 26 27 var $config = this._dealersFilter, 28 $container = $(".turkey-map__list"), 29 $turkey = $("#turkiye"); 30 31 $config = { 32 container : $container, 33 list : $container.find("ul li"), 34 35 turkey : $turkey, 36 g : $turkey.find("g"), 37 38 id : null, 39 40 data : { 41 province : "il-adi" 42 } 43 } 44 45 // List each 46 $config.list.each(function(){ 47 var _this = $(this); 48 $config.id = _this.attr("id"); 49 50 // "g" each 51 $config.g.each(function(){ 52 var _this = $(this), 53 id = _this.data( $config.data.province ); 54 55 56 // g == list 57 if ( id == $config.id ) _this.addClass( State.completed ); 58 59 }); 60 }); 61 62 63 // g "click" list "show" 64 $config.g.on("click", function(){ 65 var _this = $(this) 66 67 if ( _this.hasClass( State.completed ) ) { 68 var id = _this.data( $config.data.province ); 69 70 Elements.body.animate({ 71 scrollTop : $config.container.position().top 72 }, 500); 73 74 $config.list.show(); 75 $config.list.not("#" + id).hide(); 76 } 77 }); 78 79 80 dealersTurkeyMap(); 81 } 82 83 function dealersTurkeyMap() { 84 85 var $config = this._dealersTurkeyMap, 86 $container = $(".turkey-map__drawing"); 87 88 $config = { 89 container : $container, 90 el : $container.find("path"), 91 92 name : $(".turkey-map__name"), 93 94 data : { 95 id : "id",
96 provinceName : "il-adi", 97 plateCode : "plaka-kodu", 98 areaCode : "alan-kodu" 99 } 100 101 } 102 103 $config.el.bind({ 104 mouseenter : function(){ 105 var _this = $(this); 106 107 if ( _this.parent().attr( $config.data.id ) == "guney-kibris" ) { 108 return false 109 } 110 111 $config.name.html("<div>" + _this.parent().data( $config.data.provinceName ) + "</div>"); 112 113 _this.on("mousemove", function(event){ 114 $config.name.css("top", ( event.pageY + 25 ) ); 115 $config.name.css("left", event.pageX ); 116 }); 117 118 }, 119 mouseleave : function(){ 120 $config.name.html(""); 121 } 122 123 }) 124 125 $config.el.on("click", function( event ){ 126 var _this = $(this); 127 128 if ( _this.parent().attr( $config.data.id ) == "guney-kibris" ) return false 129 130 var il_id = _this.parent().attr( $config.data.id ), 131 il_adi = _this.parent().data( $config.data.provinceName ), 132 plaka_kodu = _this.parent().data( $config.data.plateCode ), 133 alan_kodu = _this.parent().data( $config.data.areaCode ); 134 }); 135 } 136 137 138 // Initialize ready... 139 _init(); 140 141})(window.jQuery, window, document);
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.