uikit 3.14.4-dev.ca199f7a7 → 3.14.4-dev.d014a9a57

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 (81) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/css/uikit-core-rtl.css +73 -49
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +73 -49
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +73 -50
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +73 -50
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +7 -5
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +27 -20
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +27 -20
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +1 -1
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +22 -7
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +1 -1
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +22 -7
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +3 -3
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +23 -16
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +114 -66
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +167 -102
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/images/{backgrounds/nav-parent-open.svg → components/nav-parent-icon-large.svg} +0 -0
  44. package/src/images/components/nav-parent-icon.svg +3 -0
  45. package/src/images/components/navbar-parent-icon.svg +3 -0
  46. package/src/js/components/filter.js +5 -3
  47. package/src/js/components/sortable.js +2 -3
  48. package/src/js/core/height-viewport.js +11 -5
  49. package/src/js/core/icon.js +16 -0
  50. package/src/js/core/index.js +2 -0
  51. package/src/js/core/navbar.js +44 -15
  52. package/src/js/core/sticky.js +8 -9
  53. package/src/js/mixin/position.js +24 -7
  54. package/src/js/mixin/slider-drag.js +20 -8
  55. package/src/js/mixin/togglable.js +8 -17
  56. package/src/js/util/dimensions.js +6 -6
  57. package/src/js/util/position.js +1 -0
  58. package/src/js/util/viewport.js +2 -27
  59. package/src/less/components/dropdown.less +8 -0
  60. package/src/less/components/nav.less +6 -36
  61. package/src/less/components/navbar.less +96 -14
  62. package/src/less/components/utility.less +12 -3
  63. package/src/less/theme/nav.less +0 -8
  64. package/src/less/theme/navbar.less +4 -6
  65. package/src/scss/components/dropdown.scss +8 -0
  66. package/src/scss/components/nav.scss +6 -25
  67. package/src/scss/components/navbar.scss +84 -14
  68. package/src/scss/components/utility.scss +12 -3
  69. package/src/scss/mixins-theme.scss +13 -17
  70. package/src/scss/mixins.scss +12 -13
  71. package/src/scss/theme/nav.scss +0 -8
  72. package/src/scss/theme/navbar.scss +3 -2
  73. package/src/scss/variables-theme.scss +16 -10
  74. package/src/scss/variables.scss +16 -9
  75. package/tests/drop.html +66 -16
  76. package/tests/dropdown.html +103 -16
  77. package/tests/index.html +3 -3
  78. package/tests/nav.html +20 -87
  79. package/tests/navbar.html +283 -56
  80. package/tests/offcanvas.html +8 -8
  81. package/src/images/backgrounds/nav-parent-close.svg +0 -3
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "uikit",
3
3
  "title": "UIkit",
4
4
  "description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
5
- "version": "3.14.4-dev.ca199f7a7",
5
+ "version": "3.14.4-dev.d014a9a57",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12">
2
+ <polyline fill="none" stroke="#000" stroke-width="1.1" points="1 3.5 6 8.5 11 3.5"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12">
2
+ <polyline fill="none" stroke="#000" stroke-width="1.1" points="1 3.5 6 8.5 11 3.5"/>
3
+ </svg>
@@ -103,7 +103,7 @@ export default {
103
103
  });
104
104
  },
105
105
 
106
- setState(state, animate = true) {
106
+ async setState(state, animate = true) {
107
107
  state = { filter: { '': '' }, sort: [], ...state };
108
108
 
109
109
  trigger(this.$el, 'beforeFilter', [this, state]);
@@ -112,7 +112,7 @@ export default {
112
112
  toggleClass(el, this.cls, !!matchFilter(el, this.attrItem, state))
113
113
  );
114
114
 
115
- Promise.all(
115
+ await Promise.all(
116
116
  $$(this.target, this.$el).map((target) => {
117
117
  const filterFn = () => {
118
118
  applyState(state, target, getChildren(target));
@@ -120,7 +120,9 @@ export default {
120
120
  };
121
121
  return animate ? this.animate(filterFn, target) : filterFn();
122
122
  })
123
- ).then(() => trigger(this.$el, 'afterFilter', [this]));
123
+ );
124
+
125
+ trigger(this.$el, 'afterFilter', [this]);
124
126
  },
125
127
 
126
128
  updateState() {
@@ -26,7 +26,6 @@ import {
26
26
  remove,
27
27
  removeClass,
28
28
  scrollParents,
29
- scrollTop,
30
29
  toggleClass,
31
30
  Transition,
32
31
  trigger,
@@ -313,7 +312,7 @@ function trackScroll(pos) {
313
312
  let last = Date.now();
314
313
  trackTimer = setInterval(() => {
315
314
  let { x, y } = pos;
316
- y += scrollTop(window);
315
+ y += document.scrollingElement.scrollTop;
317
316
 
318
317
  const dist = (Date.now() - last) * 0.3;
319
318
  last = Date.now();
@@ -334,7 +333,7 @@ function trackScroll(pos) {
334
333
  }
335
334
 
336
335
  if (scroll > 0 && scroll < scrollHeight - height) {
337
- scrollTop(scrollEl, scroll);
336
+ scrollEl.scrollTop = scroll;
338
337
  return true;
339
338
  }
340
339
  });
@@ -56,14 +56,20 @@ export default {
56
56
  0
57
57
  );
58
58
  } else {
59
+ const { body, scrollingElement } = document;
60
+ const isScrollingElement =
61
+ scrollingElement === scrollElement || body === scrollElement;
62
+
59
63
  // on mobile devices (iOS and Android) window.innerHeight !== 100vh
60
- minHeight = `calc(${
61
- document.scrollingElement === scrollElement ? '100vh' : `${viewportHeight}px`
62
- }`;
64
+ minHeight = `calc(${isScrollingElement ? '100vh' : `${viewportHeight}px`}`;
63
65
 
64
66
  if (this.offsetTop) {
65
- const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
66
- minHeight += top > 0 && top < viewportHeight / 2 ? ` - ${top}px` : '';
67
+ if (isScrollingElement) {
68
+ const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
69
+ minHeight += top > 0 && top < viewportHeight / 2 ? ` - ${top}px` : '';
70
+ } else {
71
+ minHeight += ` - ${css(scrollElement, 'paddingTop')}`;
72
+ }
67
73
  }
68
74
 
69
75
  if (this.offsetBottom === true) {
@@ -2,6 +2,9 @@ import SVG from './svg';
2
2
  import closeIcon from '../../images/components/close-icon.svg';
3
3
  import closeLarge from '../../images/components/close-large.svg';
4
4
  import marker from '../../images/components/marker.svg';
5
+ import navParentIcon from '../../images/components/nav-parent-icon.svg';
6
+ import navParentIconLarge from '../../images/components/nav-parent-icon-large.svg';
7
+ import navbarParentIcon from '../../images/components/navbar-parent-icon.svg';
5
8
  import navbarToggleIcon from '../../images/components/navbar-toggle-icon.svg';
6
9
  import overlayIcon from '../../images/components/overlay-icon.svg';
7
10
  import paginationNext from '../../images/components/pagination-next.svg';
@@ -19,6 +22,7 @@ import {
19
22
  $,
20
23
  addClass,
21
24
  apply,
25
+ closest,
22
26
  css,
23
27
  each,
24
28
  hasClass,
@@ -35,6 +39,9 @@ const icons = {
35
39
  marker,
36
40
  'close-icon': closeIcon,
37
41
  'close-large': closeLarge,
42
+ 'nav-parent-icon': navParentIcon,
43
+ 'nav-parent-icon-large': navParentIconLarge,
44
+ 'navbar-parent-icon': navbarParentIcon,
38
45
  'navbar-toggle-icon': navbarToggleIcon,
39
46
  'overlay-icon': overlayIcon,
40
47
  'pagination-next': paginationNext,
@@ -96,6 +103,15 @@ export const IconComponent = {
96
103
  },
97
104
  };
98
105
 
106
+ export const NavParentIcon = {
107
+ extends: IconComponent,
108
+
109
+ beforeConnect() {
110
+ const icon = this.$props.icon;
111
+ this.icon = closest(this.$el, '.uk-nav-primary') ? `${icon}-large` : icon;
112
+ },
113
+ };
114
+
99
115
  export const Slidenav = {
100
116
  extends: IconComponent,
101
117
 
@@ -29,10 +29,12 @@ export { default as Video } from './video';
29
29
  // Icon components
30
30
  export { Close } from './icon';
31
31
  export { Spinner } from './icon';
32
+ export { NavParentIcon} from './icon';
32
33
  export { Slidenav as SlidenavNext } from './icon';
33
34
  export { Slidenav as SlidenavPrevious } from './icon';
34
35
  export { Search as SearchIcon } from './icon';
35
36
  export { IconComponent as Marker } from './icon';
37
+ export { IconComponent as NavbarParentIcon } from './icon';
36
38
  export { IconComponent as NavbarToggleIcon } from './icon';
37
39
  export { IconComponent as OverlayIcon } from './icon';
38
40
  export { IconComponent as PaginationNext } from './icon';
@@ -124,7 +124,6 @@ export default {
124
124
  ...this.$props,
125
125
  boundary: this.boundary,
126
126
  pos: this.pos,
127
- offset: this.dropbar || this.offset,
128
127
  }
129
128
  );
130
129
  },
@@ -285,8 +284,8 @@ export default {
285
284
  return this.dropbar;
286
285
  },
287
286
 
288
- handler(_, { $el, align }) {
289
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
287
+ handler({ target }) {
288
+ if (!this.isDropbarDrop(target)) {
290
289
  return;
291
290
  }
292
291
 
@@ -294,7 +293,7 @@ export default {
294
293
  after(this.dropbarAnchor || this.$el, this.dropbar);
295
294
  }
296
295
 
297
- addClass($el, `${this.clsDrop}-dropbar`);
296
+ addClass(target, `${this.clsDrop}-dropbar`);
298
297
  },
299
298
  },
300
299
 
@@ -309,22 +308,47 @@ export default {
309
308
  return this.dropbar;
310
309
  },
311
310
 
312
- handler(_, { $el, align }) {
313
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
311
+ handler({ target }) {
312
+ if (!this.isDropbarDrop(target)) {
314
313
  return;
315
314
  }
316
315
 
317
- this._observer = observeResize($el, () =>
316
+ this._observer = observeResize(target, () =>
318
317
  this.transitionTo(
319
- offset($el).bottom -
318
+ offset(target).bottom -
320
319
  offset(this.dropbar).top +
321
- toFloat(css($el, 'marginBottom')),
322
- $el
320
+ toFloat(css(target, 'marginBottom')),
321
+ target
323
322
  )
324
323
  );
325
324
  },
326
325
  },
327
326
 
327
+ {
328
+ name: 'beforeposition',
329
+
330
+ el() {
331
+ return this.dropContainer;
332
+ },
333
+
334
+ filter() {
335
+ return this.dropbar;
336
+ },
337
+
338
+ handler(e, element, target, options) {
339
+ if (!this.isDropbarDrop(element)) {
340
+ return;
341
+ }
342
+
343
+ const dropbarOffset = offset(this.dropbar);
344
+
345
+ css(element, 'maxWidth', dropbarOffset.width - options.viewportOffset * 2);
346
+
347
+ options.offset[1] = dropbarOffset.top - offset(target).bottom;
348
+ options.viewportOffset += dropbarOffset.left;
349
+ },
350
+ },
351
+
328
352
  {
329
353
  name: 'beforehide',
330
354
 
@@ -336,12 +360,12 @@ export default {
336
360
  return this.dropbar;
337
361
  },
338
362
 
339
- handler(e, { $el }) {
363
+ handler(e) {
340
364
  const active = this.getActive();
341
365
 
342
366
  if (
343
367
  matches(this.dropbar, ':hover') &&
344
- active?.$el === $el &&
368
+ active?.$el === e.target &&
345
369
  !this.toggles.some((el) => active.target !== el && matches(el, ':focus'))
346
370
  ) {
347
371
  e.preventDefault();
@@ -360,8 +384,8 @@ export default {
360
384
  return this.dropbar;
361
385
  },
362
386
 
363
- handler(_, { $el, align }) {
364
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
387
+ handler({ target }) {
388
+ if (!this.isDropbarDrop(target)) {
365
389
  return;
366
390
  }
367
391
 
@@ -369,7 +393,7 @@ export default {
369
393
 
370
394
  const active = this.getActive();
371
395
 
372
- if (!active || active?.$el === $el) {
396
+ if (!active || active?.$el === target) {
373
397
  this.transitionTo(0);
374
398
  }
375
399
  },
@@ -409,6 +433,11 @@ export default {
409
433
  getDropdown(el) {
410
434
  return this.$getComponent(el, 'drop') || this.$getComponent(el, 'dropdown');
411
435
  },
436
+
437
+ isDropbarDrop(el) {
438
+ const drop = this.getDropdown(el);
439
+ return drop && hasClass(el, this.clsDrop) && drop.align !== 'stretch';
440
+ },
412
441
  },
413
442
  };
414
443
 
@@ -23,7 +23,6 @@ import {
23
23
  remove,
24
24
  removeClass,
25
25
  replaceClass,
26
- scrollTop,
27
26
  toFloat,
28
27
  toggleClass,
29
28
  toPx,
@@ -125,7 +124,9 @@ export default {
125
124
  },
126
125
 
127
126
  handler() {
128
- if (!location.hash || scrollTop(window) === 0) {
127
+ const { scrollingElement } = document;
128
+
129
+ if (!location.hash || scrollingElement.scrollTop === 0) {
129
130
  return;
130
131
  }
131
132
 
@@ -134,13 +135,11 @@ export default {
134
135
  const elOffset = getOffset(this.$el);
135
136
 
136
137
  if (this.isFixed && intersectRect(targetOffset, elOffset)) {
137
- scrollTop(
138
- window,
138
+ scrollingElement.scrollTop =
139
139
  targetOffset.top -
140
- elOffset.height -
141
- toPx(this.targetOffset, 'height', this.placeholder) -
142
- toPx(this.offset, 'height', this.placeholder)
143
- );
140
+ elOffset.height -
141
+ toPx(this.targetOffset, 'height', this.placeholder) -
142
+ toPx(this.offset, 'height', this.placeholder);
144
143
  }
145
144
  });
146
145
  },
@@ -238,7 +237,7 @@ export default {
238
237
  start,
239
238
  end,
240
239
  }) {
241
- const scroll = scrollTop(window);
240
+ const scroll = document.scrollingElement.scrollTop;
242
241
  const dir = prevScroll <= scroll ? 'down' : 'up';
243
242
 
244
243
  return {
@@ -6,7 +6,9 @@ import {
6
6
  includes,
7
7
  isRtl,
8
8
  positionAt,
9
+ scrollParents,
9
10
  toPx,
11
+ trigger,
10
12
  } from 'uikit-util';
11
13
 
12
14
  export default {
@@ -44,17 +46,32 @@ export default {
44
46
  offset = offset.reverse();
45
47
  }
46
48
 
49
+ const [scrollElement] = scrollParents(element, /auto|scroll/);
50
+ const { scrollTop, scrollLeft } = scrollElement;
51
+
47
52
  // Ensure none positioned element does not generate scrollbars
48
53
  const elDim = dimensions(element);
49
54
  css(element, { top: -elDim.height, left: -elDim.width });
50
55
 
51
- positionAt(element, target, {
52
- attach,
53
- offset,
54
- boundary,
55
- flip: this.flip,
56
- viewportOffset: this.getViewportOffset(element),
57
- });
56
+ const args = [
57
+ element,
58
+ target,
59
+ {
60
+ attach,
61
+ offset,
62
+ boundary,
63
+ flip: this.flip,
64
+ viewportOffset: this.getViewportOffset(element),
65
+ },
66
+ ];
67
+
68
+ trigger(element, 'beforeposition', args);
69
+
70
+ positionAt(...args);
71
+
72
+ // Restore scroll position
73
+ scrollElement.scrollTop = scrollTop;
74
+ scrollElement.scrollLeft = scrollLeft;
58
75
  },
59
76
 
60
77
  getPositionOffset(element) {
@@ -5,16 +5,18 @@ import {
5
5
  includes,
6
6
  isRtl,
7
7
  isTouch,
8
+ noop,
8
9
  off,
9
10
  on,
10
- pointerCancel,
11
- pointerDown,
12
- pointerMove,
13
- pointerUp,
14
11
  selInput,
15
12
  trigger,
16
13
  } from 'uikit-util';
17
14
 
15
+ const pointerOptions = { passive: false, capture: true };
16
+ const pointerDown = 'touchstart mousedown';
17
+ const pointerMove = 'touchmove mousemove';
18
+ const pointerUp = 'touchend touchcancel mouseup click input';
19
+
18
20
  export default {
19
21
  props: {
20
22
  draggable: Boolean,
@@ -69,6 +71,16 @@ export default {
69
71
  e.preventDefault();
70
72
  },
71
73
  },
74
+
75
+ {
76
+ // iOS workaround for slider stopping if swiping fast
77
+ name: `${pointerMove} ${pointerUp}`,
78
+ el() {
79
+ return this.list;
80
+ },
81
+ handler: noop,
82
+ ...pointerOptions,
83
+ },
72
84
  ],
73
85
 
74
86
  methods: {
@@ -89,10 +101,10 @@ export default {
89
101
  this.prevIndex = this.index;
90
102
  }
91
103
 
92
- on(document, pointerMove, this.move, { passive: false });
104
+ on(document, pointerMove, this.move, pointerOptions);
93
105
 
94
106
  // 'input' event is triggered by video controls
95
- on(document, `${pointerUp} ${pointerCancel} input`, this.end, true);
107
+ on(document, pointerUp, this.end, pointerOptions);
96
108
 
97
109
  css(this.list, 'userSelect', 'none');
98
110
  },
@@ -172,8 +184,8 @@ export default {
172
184
  },
173
185
 
174
186
  end() {
175
- off(document, pointerMove, this.move, { passive: false });
176
- off(document, `${pointerUp} ${pointerCancel} input`, this.end, true);
187
+ off(document, pointerMove, this.move, pointerOptions);
188
+ off(document, pointerUp, this.end, pointerOptions);
177
189
 
178
190
  if (this.dragging) {
179
191
  this.dragging = null;
@@ -10,7 +10,6 @@ import {
10
10
  isFunction,
11
11
  isVisible,
12
12
  noop,
13
- offset,
14
13
  removeClass,
15
14
  scrollParents,
16
15
  startsWith,
@@ -232,7 +231,7 @@ function slideHorizontal({ isToggled, duration, velocity, transition, _toggle },
232
231
 
233
232
  Transition.cancel(el);
234
233
 
235
- const [scrollElement] = scrollParents(el);
234
+ const [scrollElement] = scrollParents(el.offsetParent);
236
235
  css(scrollElement, 'overflowX', 'hidden');
237
236
 
238
237
  if (!isToggled(el)) {
@@ -243,17 +242,11 @@ function slideHorizontal({ isToggled, duration, velocity, transition, _toggle },
243
242
  duration = velocity * width + duration;
244
243
 
245
244
  const percent = visible ? ((width + marginLeft * (right ? -1 : 1)) / width) * 100 : 0;
246
- const offsetEl = offset(el);
247
- const useClipPath = right
248
- ? offsetEl.right < scrollElement.clientWidth
249
- : Math.round(offsetEl.left) > 0;
250
245
 
251
246
  css(el, {
252
- clipPath: useClipPath
253
- ? right
254
- ? `polygon(0 0,${percent}% 0,${percent}% 100%,0 100%)`
255
- : `polygon(${100 - percent}% 0,100% 0,100% 100%,${100 - percent}% 100%)`
256
- : '',
247
+ clipPath: right
248
+ ? `polygon(0 0,${percent}% 0,${percent}% 100%,0 100%)`
249
+ : `polygon(${100 - percent}% 0,100% 0,100% 100%,${100 - percent}% 100%)`,
257
250
  marginLeft: (((100 - percent) * (right ? 1 : -1)) / 100) * width,
258
251
  });
259
252
 
@@ -262,7 +255,7 @@ function slideHorizontal({ isToggled, duration, velocity, transition, _toggle },
262
255
  ? Transition.start(
263
256
  el,
264
257
  {
265
- clipPath: useClipPath ? `polygon(0 0,100% 0,100% 100%,0 100%)` : '',
258
+ clipPath: `polygon(0 0,100% 0,100% 100%,0 100%)`,
266
259
  marginLeft: 0,
267
260
  },
268
261
  duration * (1 - percent / 100),
@@ -271,11 +264,9 @@ function slideHorizontal({ isToggled, duration, velocity, transition, _toggle },
271
264
  : Transition.start(
272
265
  el,
273
266
  {
274
- clipPath: useClipPath
275
- ? right
276
- ? `polygon(0 0,0 0,0 100%,0 100%)`
277
- : `polygon(100% 0,100% 0,100% 100%,100% 100%)`
278
- : '',
267
+ clipPath: right
268
+ ? `polygon(0 0,0 0,0 100%,0 100%)`
269
+ : `polygon(100% 0,100% 0,100% 100%,100% 100%)`,
279
270
  marginLeft: (right ? 1 : -1) * width,
280
271
  },
281
272
  duration * (percent / 100),
@@ -94,13 +94,13 @@ export function position(element) {
94
94
  }
95
95
 
96
96
  export function offsetPosition(element) {
97
- const offset = [0, 0];
98
-
99
97
  element = toNode(element);
100
98
 
101
- do {
102
- offset[0] += element.offsetTop;
103
- offset[1] += element.offsetLeft;
99
+ const offset = [element.offsetTop, element.offsetLeft];
100
+
101
+ while ((element = element.offsetParent)) {
102
+ offset[0] += element.offsetTop + toFloat(css(element, `borderTopWidth`));
103
+ offset[1] += element.offsetLeft + toFloat(css(element, `borderLeftWidth`));
104
104
 
105
105
  if (css(element, 'position') === 'fixed') {
106
106
  const win = toWindow(element);
@@ -108,7 +108,7 @@ export function offsetPosition(element) {
108
108
  offset[1] += win.scrollX;
109
109
  return offset;
110
110
  }
111
- } while ((element = element.offsetParent));
111
+ }
112
112
 
113
113
  return offset;
114
114
  }
@@ -159,6 +159,7 @@ function attachToWithFlip(element, target, options) {
159
159
  return newPos;
160
160
  }
161
161
  }
162
+ continue;
162
163
  }
163
164
 
164
165
  // Move
@@ -1,18 +1,7 @@
1
1
  import { css } from './style';
2
2
  import { isVisible, parents } from './filter';
3
3
  import { offset, offsetPosition } from './dimensions';
4
- import {
5
- clamp,
6
- findIndex,
7
- intersectRect,
8
- isDocument,
9
- isUndefined,
10
- isWindow,
11
- toFloat,
12
- toNode,
13
- toWindow,
14
- ucfirst,
15
- } from './lang';
4
+ import { clamp, findIndex, intersectRect, isWindow, toFloat, toWindow, ucfirst } from './lang';
16
5
 
17
6
  export function isInView(element, offsetTop = 0, offsetLeft = 0) {
18
7
  if (!isVisible(element)) {
@@ -35,20 +24,6 @@ export function isInView(element, offsetTop = 0, offsetLeft = 0) {
35
24
  );
36
25
  }
37
26
 
38
- export function scrollTop(element, top) {
39
- if (isWindow(element) || isDocument(element)) {
40
- element = scrollingElement(element);
41
- } else {
42
- element = toNode(element);
43
- }
44
-
45
- if (isUndefined(top)) {
46
- return element.scrollTop;
47
- } else {
48
- element.scrollTop = top;
49
- }
50
- }
51
-
52
27
  export function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
53
28
  const parents = isVisible(element) ? scrollParents(element) : [];
54
29
  return parents.reduce(
@@ -90,7 +65,7 @@ export function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
90
65
  (function step() {
91
66
  const percent = ease(clamp((Date.now() - start) / duration));
92
67
 
93
- scrollTop(element, scroll + top * percent);
68
+ element.scrollTop = scroll + top * percent;
94
69
 
95
70
  // scroll more if we have not reached our destination
96
71
  if (percent === 1) {
@@ -25,6 +25,8 @@
25
25
  @dropdown-background: @global-muted-background;
26
26
  @dropdown-color: @global-color;
27
27
 
28
+ @dropdown-large-padding: 40px;
29
+
28
30
  @dropdown-nav-item-color: @global-muted-color;
29
31
  @dropdown-nav-item-hover-color: @global-color;
30
32
  @dropdown-nav-subtitle-font-size: @global-small-font-size;
@@ -69,6 +71,12 @@
69
71
  .uk-dropdown.uk-open { display: block; }
70
72
 
71
73
 
74
+ /* Size modifier
75
+ ========================================================================== */
76
+
77
+ .uk-dropdown-large { padding: @dropdown-large-padding; }
78
+
79
+
72
80
  /* Stretch modifier
73
81
  ========================================================================== */
74
82