1"use strict"; 2function _classCallCheck(e, t) { 3 if (!(e instanceof t)) 4 throw new TypeError("Cannot call a class as a function"); 5} 6var _extends = 7 Object.assign || 8 function(e) { 9 for (var t = 1; t < arguments.length; t++) { 10 var i = arguments[t]; 11 for (var n in i) 12 Object.prototype.hasOwnProperty.call(i, n) && (e[n] = i[n]); 13 } 14 return e; 15 }, 16 _createClass = (function() { 17 function e(e, t) { 18 for (var i = 0; i < t.length; i++) { 19 var n = t[i]; 20 (n.enumerable = n.enumerable || !1), 21 (n.configurable = !0), 22 "value" in n && (n.writable = !0), 23 Object.defineProperty(e, n.key, n); 24 } 25 } 26 return function(t, i, n) { 27 return i && e(t.prototype, i), n && e(t, n), t; 28 }; 29 })(), 30 Slinky = (function() { 31 function e(t) { 32 var i = 33 arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; 34 _classCallCheck(this, e), 35 (this.settings = _extends({}, this.options, i)), 36 this._init(t); 37 } 38 return ( 39 _createClass(e, [ 40 { 41 key: "options", 42 get: function() { 43 return { 44 resize: !0, 45 speed: 300, 46 theme: "slinky-theme-default", 47 title: !1 48 }; 49 } 50 } 51 ]), 52 _createClass(e, [ 53 { 54 key: "_init", 55 value: function(e) { 56 (this.menu = $(e)), (this.base = this.menu.children().first()); 57 this.base; 58 var t = this.menu, 59 i = this.settings; 60 t.addClass("slinky-menu").addClass(i.theme), 61 this._transition(i.speed), 62 $("a + ul", t) 63 .prev() 64 .addClass("next"), 65 $("li > a", t).wrapInner("<span>"); 66 var n = $("<li>").addClass("nav-back"); 67 $("li > ul", t).prepend(n); 68 var s = $("<a>") 69 .prop("href", "#") 70 .addClass("back"); 71 $(".nav-back", t).prepend(s), 72 i.title && 73 $("li > ul", t).each(function(e, t) { 74 var i = $(t) 75 .parent() 76 .find("a") 77 .first() 78 .text(); 79 if (i) { 80 var n = $("<span>") 81 .addClass("title") 82 .text("Ðазад"); 83 $("> .nav-back .back", t).append(n); 84 } 85 }), 86 this._addListeners(), 87 this._jumpToInitial(); 88 } 89 }, 90 { 91 key: "_addListeners", 92 value: function() { 93 var e = this, 94 t = this.menu, 95 i = this.settings; 96 $("a", t).on("click", function(n) { 97 if (e._clicked + i.speed > Date.now()) return !1; 98 e._clicked = Date.now(); 99 var s = $(n.currentTarget); 100 (0 === s.attr("href").indexOf("#") || 101 s.hasClass("next") || 102 s.hasClass("back")) && 103 n.preventDefault(), 104 s.hasClass("next") 105 ? (t.find(".active").removeClass("active"), 106 s 107 .next() 108 .show() 109 .addClass("active"), 110 e._move(1), 111 i.resize && e._resize(s.next())) 112 : s.hasClass("back") && 113 (e._move(-1, function() { 114 t.find(".active").removeClass("active"), 115 s 116 .parent() 117 .parent() 118 .hide() 119 .parentsUntil(t, "ul") 120 .first() 121 .addClass("active"); 122 }), 123 i.resize && 124 e._resize( 125 s 126 .parent() 127 .parent() 128 .parentsUntil(t, "ul") 129 )); 130 }); 131 } 132 }, 133 { 134 key: "_jumpToInitial", 135 value: function() { 136 var e = this.menu.find(".active"); 137 e.length > 0 && (e.removeClass("active"), this.jump(e, !1)); 138 } 139 }, 140 { 141 key: "_move", 142 value: function() { 143 var e = 144 arguments.length > 0 && void 0 !== arguments[0] 145 ? arguments[0] 146 : 0, 147 t = 148 arguments.length > 1 && void 0 !== arguments[1] 149 ? arguments[1] 150 : function() {}; 151 if (0 !== e) { 152 var i = this.settings, 153 n = this.base, 154 s = Math.round(parseInt(n.get(0).style.left)) || 0; 155 n.css("left", s - 100 * e + "%"), 156 "function" == typeof t && setTimeout(t, i.speed); 157 } 158 } 159 }, 160 { 161 key: "_resize", 162 value: function(e) { 163 this.menu.height(e.outerHeight()); 164 } 165 }, 166 { 167 key: "_transition", 168 value: function() { 169 var e = 170 arguments.length > 0 && void 0 !== arguments[0] 171 ? arguments[0] 172 : 300, 173 t = this.menu, 174 i = this.base; 175 t.css("transition-duration", e + "ms"), 176 i.css("transition-duration", e + "ms"); 177 } 178 }, 179 { 180 key: "jump", 181 value: function(e) { 182 var t = 183 !(arguments.length > 1 && void 0 !== arguments[1]) || 184 arguments[1]; 185 if (e) { 186 var i = this.menu, 187 n = this.settings, 188 s = $(e), 189 a = i.find(".active"), 190 r = 0; 191 a.length > 0 && (r = a.parentsUntil(i, "ul").length), 192 i 193 .find("ul") 194 .removeClass("active") 195 .hide(); 196 var l = s.parentsUntil(i, "ul"); 197 l.show(), 198 s.show().addClass("active"), 199 t || this._transition(0), 200 this._move(l.length - r), 201 n.resize && this._resize(s), 202 t || this._transition(n.speed); 203 } 204 } 205 }, 206 { 207 key: "home", 208 value: function() { 209 var e = 210 !(arguments.length > 0 && void 0 !== arguments[0]) || 211 arguments[0], 212 t = this.base, 213 i = this.menu, 214 n = this.settings; 215 e || this._transition(0); 216 var s = i.find(".active"), 217 a = s.parentsUntil(i, "ul"); 218 this._move(-a.length, function() { 219 s.removeClass("active").hide(), a.not(t).hide(); 220 }), 221 n.resize && this._resize(t), 222 !1 === e && this._transition(n.speed); 223 } 224 }, 225 {
226 key: "destroy", 227 value: function() { 228 var e = this, 229 t = this.base, 230 i = this.menu; 231 $(".nav-back", i).remove(), 232 $("a", i) 233 .removeClass("next") 234 .off("click"), 235 i.css({ height: "", "transition-duration": "" }), 236 t.css({ left: "", "transition-duration": "" }), 237 $("li > a > span", i) 238 .contents() 239 .unwrap(), 240 i.find(".active").removeClass("active"), 241 i 242 .attr("class") 243 .split(" ") 244 .forEach(function(e) { 245 0 === e.indexOf("slinky") && i.removeClass(e); 246 }), 247 ["settings", "menu", "base"].forEach(function(t) { 248 return delete e[t]; 249 }); 250 } 251 } 252 ]), 253 e 254 ); 255 })(); 256jQuery.fn.slinky = function(e) { 257 return new Slinky(this, e); 258}; 259//# sourceMappingURL=slinky.min.js.map
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.