soames-gatsby-theme 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/LICENSE +29 -0
  2. package/README.md +24 -0
  3. package/dist/gatsby-config.js +47 -0
  4. package/dist/gatsby-node.js +7 -0
  5. package/dist/src/components/Bio.js +23 -0
  6. package/dist/src/components/BlogSidebar.js +30 -0
  7. package/dist/src/components/Footer.js +11 -0
  8. package/dist/src/components/FooterMenu.js +26 -0
  9. package/dist/src/components/Header.js +12 -0
  10. package/dist/src/components/HeaderMenu.js +34 -0
  11. package/dist/src/components/HeroHeader.js +39 -0
  12. package/dist/src/components/Layout.js +24 -0
  13. package/dist/src/components/Logo.js +17 -0
  14. package/dist/src/components/Seo.js +59 -0
  15. package/dist/src/components/shortcodes/RemoveContentAreaPadding.js +12 -0
  16. package/dist/src/components/shortcodes/SoamesFeature.js +9 -0
  17. package/dist/src/components/shortcodes/SoamesGalleryMenu.js +15 -0
  18. package/dist/src/components/shortcodes/SoamesIconList.js +15 -0
  19. package/dist/src/components/shortcodes/SoamesSoundCloud.js +18 -0
  20. package/dist/src/components/shortcodes/SoamesTextBlock.js +8 -0
  21. package/dist/src/components/shortcodes/SoamesTextList.js +8 -0
  22. package/dist/src/components/shortcodes/SoamesTitle.js +7 -0
  23. package/dist/src/components/shortcodes/SoamesTitleBar.js +7 -0
  24. package/dist/src/components/shortcodes/SoamesTitleBarLg.js +25 -0
  25. package/dist/src/components/shortcodes/SoamesVideo.js +8 -0
  26. package/dist/src/pages/index.js +9 -0
  27. package/dist/src/templates/blog-post-archive.js +59 -0
  28. package/dist/src/templates/blog-post.js +67 -0
  29. package/dist/src/templates/page.js +33 -0
  30. package/dist/src/utils/shortcodes/Shortcodes.js +105 -0
  31. package/dist/src/utils/shortcodes/getAttributes.js +18 -0
  32. package/dist/src/utils/shortcodes/getContent.js +7 -0
  33. package/gatsby-browser.js +11 -0
  34. package/gatsby-node.js +138 -0
  35. package/gatsby-ssr.js +12 -0
  36. package/package.json +76 -0
  37. package/src/components/Bio.tsx +63 -0
  38. package/src/components/BlogSidebar.tsx +86 -0
  39. package/src/components/Footer.tsx +53 -0
  40. package/src/components/FooterMenu.tsx +66 -0
  41. package/src/components/Header.tsx +37 -0
  42. package/src/components/HeaderMenu.tsx +123 -0
  43. package/src/components/HeroHeader.tsx +75 -0
  44. package/src/components/Layout.tsx +60 -0
  45. package/src/components/Logo.tsx +49 -0
  46. package/src/components/Seo.tsx +84 -0
  47. package/src/components/shortcodes/RemoveContentAreaPadding.tsx +13 -0
  48. package/src/components/shortcodes/SoamesFeature.tsx +54 -0
  49. package/src/components/shortcodes/SoamesGalleryMenu.tsx +63 -0
  50. package/src/components/shortcodes/SoamesIconList.tsx +57 -0
  51. package/src/components/shortcodes/SoamesSoundCloud.tsx +71 -0
  52. package/src/components/shortcodes/SoamesTextBlock.tsx +27 -0
  53. package/src/components/shortcodes/SoamesTextList.tsx +27 -0
  54. package/src/components/shortcodes/SoamesTitle.tsx +23 -0
  55. package/src/components/shortcodes/SoamesTitleBar.tsx +21 -0
  56. package/src/components/shortcodes/SoamesTitleBarLg.tsx +56 -0
  57. package/src/components/shortcodes/SoamesVideo.tsx +34 -0
  58. package/src/styles/soames/base.css +592 -0
  59. package/src/styles/soames/components.css +1551 -0
  60. package/src/styles/soames/layout.css +209 -0
  61. package/src/styles/soames/overrides.css +1779 -0
  62. package/src/styles/soames/typography.css +23 -0
  63. package/src/styles/theme.css +8 -0
  64. package/src/styles/vendor/normalize.css +343 -0
  65. package/src/styles/vendor/wordpress-blocks.css +3451 -0
  66. package/src/templates/blog-post-archive.tsx +167 -0
  67. package/src/templates/blog-post.tsx +183 -0
  68. package/src/templates/page.tsx +65 -0
  69. package/src/utils/shortcodes/Shortcodes.tsx +119 -0
  70. package/src/utils/shortcodes/getAttributes.ts +19 -0
  71. package/src/utils/shortcodes/getContent.ts +5 -0
  72. package/static/js/soames-nav-dropdown.js +646 -0
  73. package/static/js/soames-navbar-dropdown.js +127 -0
@@ -0,0 +1,646 @@
1
+ const jQuery = require("jquery");
2
+
3
+ (function($){
4
+
5
+ var NAME = 'navDropdown';
6
+ var DATA_KEY = 'bs.nav-dropdown';
7
+ var EVENT_KEY = '.' + DATA_KEY;
8
+ var DATA_API_KEY = '.data-api';
9
+ var JQUERY_NO_CONFLICT = $.fn[NAME];
10
+
11
+ var Event = {
12
+ HIDE: 'hide' + EVENT_KEY,
13
+ HIDDEN: 'hidden' + EVENT_KEY,
14
+ SHOW: 'show' + EVENT_KEY,
15
+ SHOWN: 'shown' + EVENT_KEY,
16
+ CLICK: 'click' + EVENT_KEY,
17
+ READY: 'ready' + EVENT_KEY,
18
+ COLLAPSE: 'collapse' + EVENT_KEY,
19
+ LOAD_DATA_API: 'ready' + EVENT_KEY + DATA_API_KEY,
20
+ CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
21
+ RESIZE_DATA_API: 'resize' + EVENT_KEY + DATA_API_KEY,
22
+ KEYDOWN_DATA_API: 'keydown' + EVENT_KEY + DATA_API_KEY,
23
+ NAVBAR_COLLAPSE: 'collapse.bs.navbar-dropdown'
24
+ };
25
+
26
+ var Hotkeys = {
27
+ ESC: 27,
28
+ LEFT: 37,
29
+ UP: 38,
30
+ RIGHT: 39,
31
+ DOWN: 40
32
+ };
33
+
34
+ var Breakpoints = {
35
+ XS: 544,
36
+ SM: 768,
37
+ MD: 992,
38
+ LG: 1200,
39
+ XL: Infinity
40
+ };
41
+
42
+ var ClassName = {
43
+ BACKDROP: 'dropdown-backdrop',
44
+ DISABLED: 'disabled',
45
+ OPEN: 'open',
46
+ SM: 'nav-dropdown-sm'
47
+ };
48
+
49
+ var Selector = {
50
+ BASE: '.nav-dropdown',
51
+ DROPDOWN: '.dropdown',
52
+ DROPDOWN_MENU: '.dropdown-menu',
53
+ BACKDROP: '.' + ClassName.BACKDROP,
54
+ DATA_BUTTON: '[data-button]',
55
+ DATA_TOGGLE: '[data-toggle="dropdown-submenu"]',
56
+ FORM_CHILD: '.dropdown form'
57
+ };
58
+
59
+
60
+
61
+ var $$ = (function(){
62
+
63
+ function Item(elements, prevItem) {
64
+ if (!('length' in elements)) elements = [elements];
65
+ this.props = {};
66
+ this.length = elements.length;
67
+ if (prevItem) {
68
+ this.prevItem = prevItem;
69
+ $.extend(this.props, prevItem.props);
70
+ }
71
+ for (var i = 0; i < elements.length; i++) {
72
+ this[i] = elements[i];
73
+ }
74
+ }
75
+
76
+ Item.prototype.eq = function(index) {
77
+ return new Item(this[index] ? this[index] : [], this);
78
+ };
79
+
80
+ Item.prototype.parent = function() {
81
+ return new Item(
82
+
83
+ $(this).map(function(){
84
+
85
+ var $$this = new Item(this);
86
+
87
+ if ($$this.is(':upper')) return null;
88
+
89
+ return $( $$this.is(':toggle') ? this.parentNode.parentNode : this )
90
+ .closest(Selector.DROPDOWN)
91
+ .find('>' + Selector.DATA_TOGGLE)[0];
92
+
93
+ }),
94
+
95
+ this
96
+
97
+ );
98
+ };
99
+
100
+ Item.prototype.parents = function(selector) {
101
+ var elements = $(this).map(function(){
102
+
103
+ return (new Item(this)).is(':toggle') ? this.parentNode : this;
104
+
105
+ }).parentsUntil(Selector.BASE, Selector.DROPDOWN);
106
+
107
+ if (selector === ':upper') elements = elements.last();
108
+
109
+ elements = elements.find('>' + Selector.DATA_TOGGLE);
110
+
111
+ return new Item(elements, this);
112
+ };
113
+
114
+ Item.prototype.children = function(deepSearch) {
115
+
116
+ var elements = [];
117
+
118
+ $(this).each(function(){
119
+
120
+ var $parent, $items, $$item = new Item(this);
121
+
122
+ if ($$item.is(':root')) {
123
+ $parent = $(this);
124
+ } else if ($$item.is(':toggle')) {
125
+ $parent = $(this).parent().find('>' + Selector.DROPDOWN_MENU);
126
+ } else {
127
+ return;
128
+ }
129
+
130
+ if (deepSearch) {
131
+ $items = $parent.find('a');
132
+ } else if ($$item.is(':root')) {
133
+ $items = $parent.find('>li>a');
134
+ } else {
135
+ $items = $parent.find('>a, >' + Selector.DROPDOWN + '>a');
136
+ }
137
+
138
+ $items.each(function(){
139
+
140
+ if ((deepSearch && !this.offsetWidth && !this.offsetHeight)
141
+ || this.disabled || $(this).is(Selector.DATA_BUTTON) || $(this).hasClass(ClassName.DISABLED) || ~$.inArray(this, elements)) {
142
+ return;
143
+ }
144
+
145
+ elements.push(this);
146
+
147
+ });
148
+
149
+ });
150
+
151
+ return new Item(elements, this);
152
+
153
+ };
154
+
155
+ Item.prototype.root = function() {
156
+ return new Item(
157
+ $(this).closest(Selector.BASE),
158
+ this
159
+ );
160
+ };
161
+
162
+ Item.prototype.jump = function(step) {
163
+ step = step || 'next';
164
+
165
+ if (!this.length) {
166
+ return new Item([], this);
167
+ }
168
+
169
+ var children, $$item = this.eq(0);
170
+ if (this.is(':flat') || $$item.is(':upper')) {
171
+ children = $$item.root().children( this.is(':flat') );
172
+ } else {
173
+ children = $$item.parent().children();
174
+ }
175
+
176
+ var index = $.inArray(this[0], children);
177
+ if (!children.length || !~index) {
178
+ return new Item([], this);
179
+ }
180
+
181
+ if (step === 'next') {
182
+ index += 1;
183
+ if (index < children.length) {
184
+ return new Item(children[index], this);
185
+ }
186
+ step = 'first';
187
+ } else if (step === 'prev') {
188
+ index -= 1;
189
+ if (index >= 0) {
190
+ return new Item(children[index], this);
191
+ }
192
+ step = 'last';
193
+ }
194
+
195
+ if (step === 'first') return new Item(children[0], this);
196
+ if (step === 'last') return new Item(children[ children.length - 1 ], this);
197
+
198
+ return new Item([], this);
199
+ };
200
+
201
+ Item.prototype.next = function() {
202
+ return this.jump('next');
203
+ };
204
+
205
+ Item.prototype.prev = function() {
206
+ return this.jump('prev');
207
+ };
208
+
209
+ Item.prototype.first = function() {
210
+ return this.jump('first');
211
+ };
212
+
213
+ Item.prototype.last = function() {
214
+ return this.jump('last');
215
+ };
216
+
217
+ Item.prototype.prop = function(name, value) {
218
+ if (arguments.length) {
219
+ if (arguments.length > 1) {
220
+ this.props[name] = value;
221
+ return this;
222
+ }
223
+ if (typeof arguments[0] == 'object') {
224
+ $.extend(this.props, arguments[0]);
225
+ return this;
226
+ }
227
+ return (name in this.props) ?
228
+ this.props[name] : null;
229
+ }
230
+ return $.extend({}, this.props);
231
+ };
232
+
233
+ Item.prototype.removeProp = function(name) {
234
+ delete this.props[name];
235
+ return this;
236
+ };
237
+
238
+ Item.prototype.is = function(selector) {
239
+ var $this = $(this),
240
+ selectors = (selector || '').split(/(?=[*#.[:\s])/);
241
+
242
+ while (selector === selectors.pop()){
243
+
244
+ switch (selector){
245
+
246
+ case ':root':
247
+ if (!$this.is(Selector.BASE))
248
+ return false;
249
+ break;
250
+
251
+ case ':upper':
252
+ if (!$this.parent().parent().is(Selector.BASE))
253
+ return false;
254
+ break;
255
+
256
+ case ':opened':
257
+ case ':closed':
258
+ if ((selector === ':opened') !== $this.parent().hasClass(ClassName.OPEN))
259
+ return false;
260
+ break;
261
+ case ':toggle':
262
+ if (!$this.is(Selector.DATA_TOGGLE))
263
+ return false;
264
+ break;
265
+
266
+ default:
267
+ if (!this.props[selector])
268
+ return false;
269
+ break;
270
+
271
+ }
272
+
273
+ }
274
+
275
+ return true;
276
+ };
277
+
278
+ Item.prototype.open = function() {
279
+ if (this.is(':closed')) {
280
+ this.click();
281
+ }
282
+ return this;
283
+ };
284
+
285
+ Item.prototype.close = function() {
286
+ if (this.is(':opened')) {
287
+ this.click();
288
+ }
289
+ return this;
290
+ };
291
+
292
+ Item.prototype.focus = function() {
293
+ if (this.length) {
294
+ this[0].focus();
295
+ }
296
+ return this;
297
+ };
298
+
299
+ Item.prototype.click = function() {
300
+ if (this.length) {
301
+ $(this[0]).trigger('click');
302
+ }
303
+ return this;
304
+ }
305
+
306
+ return function(element) {
307
+ return new Item(element);
308
+ };
309
+
310
+ })();
311
+
312
+
313
+
314
+ var NavDropdown = function(element){
315
+ this._element = element;
316
+ $(this._element).on(Event.CLICK, this.toggle);
317
+ };
318
+
319
+ NavDropdown.prototype.toggle = function(event) {
320
+ if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
321
+ return false;
322
+ }
323
+
324
+ var $parent = $(this.parentNode);
325
+ var isActive = $parent.hasClass(ClassName.OPEN);
326
+ var isCollapsed = NavDropdown._isCollapsed( $(this).closest(Selector.BASE) );
327
+
328
+ NavDropdown._clearMenus(
329
+ $.Event('click', {
330
+ target: this,
331
+ data: {
332
+ toggles: isCollapsed ? [this] : null
333
+ }
334
+ })
335
+ );
336
+
337
+ if (isActive) {
338
+ return false;
339
+ }
340
+
341
+ if ('ontouchstart' in document.documentElement
342
+ && !$parent.closest(Selector.DROPDOWN + '.' + ClassName.OPEN).length) {
343
+
344
+ // if mobile we use a backdrop because click events don't delegate
345
+ var dropdown = document.createElement('div');
346
+ dropdown.className = ClassName.BACKDROP;
347
+ $(dropdown).insertBefore( $(this).closest(Selector.BASE) );
348
+ $(dropdown).on('click', NavDropdown._clearMenus);
349
+
350
+ }
351
+
352
+ var relatedTarget = { relatedTarget: this };
353
+ var showEvent = $.Event(Event.SHOW, relatedTarget);
354
+
355
+ $parent.trigger(showEvent);
356
+
357
+ if (showEvent.isDefaultPrevented()) {
358
+ return false;
359
+ }
360
+
361
+ this.focus();
362
+ this.setAttribute('aria-expanded', 'true');
363
+
364
+ $parent.toggleClass(ClassName.OPEN);
365
+ $parent.trigger( $.Event(Event.SHOWN, relatedTarget) );
366
+
367
+ return false;
368
+ };
369
+
370
+ NavDropdown.prototype.dispose = function() {
371
+ $.removeData(this._element, DATA_KEY);
372
+ $(this._element).off(EVENT_KEY);
373
+ this._element = null;
374
+ };
375
+
376
+ NavDropdown._clearMenus = function(event) {
377
+ event = event || {};
378
+
379
+ if (event.which === 3) {
380
+ return;
381
+ }
382
+
383
+ var collapseEvent;
384
+ var filter = function(){ return false; };
385
+
386
+ if (event.target) {
387
+
388
+ if (this === document) {
389
+
390
+ if ( $(event.target).is('a:not([disabled], .' + ClassName.DISABLED + ')') ) {
391
+ collapseEvent = $.Event(Event.COLLAPSE, { relatedTarget: event.target })
392
+ } else {
393
+
394
+ var $rootNode = (event.targetWrapper && $(event.targetWrapper).find(Selector.BASE)) || $(event.target).closest(Selector.BASE);
395
+
396
+ if (NavDropdown._isCollapsed($rootNode)) return;
397
+ }
398
+
399
+ } else {
400
+
401
+ if ($(event.target).hasClass(ClassName.BACKDROP)) {
402
+ var $nextNode = $(event.target).next();
403
+ if ($nextNode.is(Selector.BASE) && NavDropdown._isCollapsed($nextNode)) {
404
+ return;
405
+ }
406
+ }
407
+
408
+ }
409
+
410
+ if ($(event.target).is(Selector.DATA_TOGGLE)) {
411
+ filter = $(event.target.parentNode).parents(Selector.DROPDOWN).find('>' + Selector.DATA_TOGGLE);
412
+ } else {
413
+ $(Selector.BACKDROP).remove();
414
+ }
415
+
416
+ }
417
+
418
+ var toggles = (event.data && event.data.toggles && $(event.data.toggles).parent().find(Selector.DATA_TOGGLE)) || $.makeArray( $(Selector.DATA_TOGGLE).not(filter) );
419
+
420
+ for (var i = 0; i < toggles.length; i++) {
421
+
422
+ var parent = toggles[i].parentNode;
423
+ var relatedTarget = { relatedTarget: toggles[i] };
424
+
425
+ if (!$(parent).hasClass(ClassName.OPEN)) {
426
+ continue;
427
+ }
428
+
429
+ if (event.type === 'click' &&
430
+ (/input|textarea/i.test(event.target.tagName)) &&
431
+ ($.contains(parent, event.target))) {
432
+ continue;
433
+ }
434
+
435
+ var hideEvent = $.Event(Event.HIDE, relatedTarget);
436
+ $(parent).trigger(hideEvent);
437
+ if (hideEvent.isDefaultPrevented()) {
438
+ continue;
439
+ }
440
+
441
+ toggles[i].setAttribute('aria-expanded', 'false');
442
+
443
+ $(parent)
444
+ .removeClass(ClassName.OPEN)
445
+ .trigger( $.Event(Event.HIDDEN, relatedTarget) );
446
+
447
+ }
448
+
449
+ if (collapseEvent) {
450
+ $(document).trigger(collapseEvent);
451
+ }
452
+
453
+ };
454
+
455
+ // static
456
+ NavDropdown._dataApiKeydownHandler = function(event) {
457
+
458
+ if (/input|textarea/i.test(event.target.tagName)) {
459
+ return;
460
+ }
461
+
462
+ // ????
463
+ var found;
464
+ for (var k in Hotkeys) {
465
+ if (found === (Hotkeys[k] === event.which)) {
466
+ break;
467
+ }
468
+ }
469
+ if (!found) return;
470
+
471
+ event.preventDefault();
472
+ event.stopPropagation();
473
+
474
+ if (event.which === Hotkeys.ESC) {
475
+
476
+ if (NavDropdown._isCollapsed(this)) {
477
+ return;
478
+ }
479
+
480
+ var toggle = $(event.target).parents(Selector.DROPDOWN + '.' + ClassName.OPEN)
481
+ .last().find('>' + Selector.DATA_TOGGLE);
482
+ NavDropdown._clearMenus();
483
+ toggle.trigger('focus');
484
+ return;
485
+
486
+ }
487
+
488
+ if (event.target.tagName !== 'A') {
489
+ return;
490
+ }
491
+
492
+ var $$item = $$(event.target);
493
+
494
+ $$item.prop(':flat', NavDropdown._isCollapsed($$item.root()));
495
+
496
+ if ($$item.is(':flat')){
497
+
498
+ if (event.which === Hotkeys.DOWN || event.which === Hotkeys.UP) {
499
+
500
+ $$item[ event.which === Hotkeys.UP ? 'prev' : 'next' ]().focus();
501
+
502
+ } else if (event.which === Hotkeys.LEFT) {
503
+
504
+ if ($$item.is(':opened')) {
505
+ $$item.close();
506
+ } else {
507
+ $$item.parent().close().focus();
508
+ }
509
+
510
+ } else if (event.which === Hotkeys.RIGHT && $$item.is(':toggle')) {
511
+ $$item.open();
512
+ }
513
+
514
+ } else if ($$item.is(':upper')) {
515
+
516
+ if (event.which === Hotkeys.LEFT || event.which === Hotkeys.RIGHT) {
517
+
518
+ $$item[event.which === Hotkeys.LEFT ? 'prev' : 'next']().focus().open();
519
+ if ($$item.is(':toggle')) $$item.close();
520
+
521
+ } else if ((event.which === Hotkeys.DOWN || event.which === Hotkeys.UP) && $$item.is(':toggle')) {
522
+
523
+ $$item.children()[ event.which === Hotkeys.DOWN ? 'first' : 'last' ]().focus();
524
+
525
+ }
526
+
527
+ } else {
528
+
529
+ if (event.which === Hotkeys.LEFT) {
530
+
531
+ var $$parent = $$item.parent();
532
+
533
+ if ($$parent.is(':upper')) {
534
+ $$parent.close().prev().focus().open();
535
+ } else {
536
+ $$parent.focus().close();
537
+ }
538
+
539
+ } else if (event.which === Hotkeys.RIGHT) {
540
+
541
+ var $$children = $$item.children();
542
+ if ($$children.length) {
543
+ $$item.open();
544
+ $$children.first().focus();
545
+ } else {
546
+ $$item.parents(':upper').close().next().focus().open();
547
+ }
548
+
549
+ } else if (event.which === Hotkeys.DOWN || event.which === Hotkeys.UP) {
550
+
551
+ $$item[ event.which === Hotkeys.UP ? 'prev' : 'next' ]().focus();
552
+
553
+ }
554
+
555
+ }
556
+
557
+ };
558
+
559
+ // static
560
+ NavDropdown._isCollapsed = function(rootNode) {
561
+ var match;
562
+ if (rootNode.length) rootNode = rootNode[0];
563
+ return rootNode && (match = /navbar-toggleable-(xs|sm|md|lg|xl)/.exec(rootNode.className))
564
+ && (window.innerWidth < Breakpoints[ match[1].toUpperCase() ]);
565
+ };
566
+
567
+ // static
568
+ NavDropdown._dataApiResizeHandler = function() {
569
+
570
+ $(Selector.BASE).each(function(){
571
+
572
+ var isCollapsed = NavDropdown._isCollapsed(this);
573
+
574
+ $(this).find(Selector.DROPDOWN).removeClass(ClassName.OPEN);
575
+ $(this).find('[aria-expanded="true"]').attr('aria-expanded', 'false');
576
+
577
+ var backdrop = $(Selector.BACKDROP)[0];
578
+ if (backdrop) {
579
+ backdrop.parentNode.removeChild(backdrop); // ???
580
+ }
581
+
582
+ if (isCollapsed === $(this).hasClass(ClassName.SM)) {
583
+ return;
584
+ }
585
+
586
+ if (isCollapsed) {
587
+ $(this).addClass(ClassName.SM);
588
+ } else {
589
+ $(this).removeClass(ClassName.SM);
590
+
591
+ // $(this).removeClass(ClassName.SM + ' in'); /// ???
592
+ // NavDropdown._clearMenus();
593
+ }
594
+
595
+ });
596
+ };
597
+
598
+ /**
599
+ * ------------------------------------------------------------------------
600
+ * jQuery
601
+ * ------------------------------------------------------------------------
602
+ */
603
+
604
+ $.fn[NAME] = function(config) {
605
+ return this.each(function(){
606
+
607
+ var data = $(this).data(DATA_KEY);
608
+
609
+ if (!data) {
610
+ $(this).data(DATA_KEY, (data = new NavDropdown(this)));
611
+ }
612
+
613
+ if (typeof config === 'string') {
614
+ if (data[config] === undefined) {
615
+ throw new Error('No method named "' + config + '"');
616
+ }
617
+ data[config].call(this);
618
+ }
619
+
620
+ });
621
+ };
622
+ $.fn[NAME].noConflict = function() {
623
+ $.fn[NAME] = JQUERY_NO_CONFLICT;
624
+ return this;
625
+ };
626
+ $.fn[NAME].Constructor = NavDropdown;
627
+ $.fn[NAME].$$ = $$;
628
+
629
+
630
+ $(window)
631
+ .on(Event.RESIZE_DATA_API + ' ' + Event.LOAD_DATA_API, NavDropdown._dataApiResizeHandler);
632
+
633
+ $(document)
634
+ .on(Event.KEYDOWN_DATA_API, Selector.BASE, NavDropdown._dataApiKeydownHandler)
635
+ .on(Event.NAVBAR_COLLAPSE, NavDropdown._clearMenus)
636
+ .on(Event.CLICK_DATA_API, NavDropdown._clearMenus)
637
+ .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, NavDropdown.prototype.toggle)
638
+ .on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function(e){
639
+ e.stopPropagation();
640
+ });
641
+
642
+ $(window)
643
+ .trigger(Event.READY);
644
+
645
+
646
+ })(jQuery);