@kizmann/pico-js 0.4.13 → 0.4.15
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/pico-js.js +1 -1
- package/dist/pico-js.js.map +1 -1
- package/package.json +1 -1
- package/src/index.js +3 -9
- package/src/library/element.js +9 -0
- package/src/library/map.js +2 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
@@ -85,14 +85,8 @@ if ( typeof global.pi === 'undefined' && global.navigator ) {
|
|
85
85
|
global.pi = Pico;
|
86
86
|
}
|
87
87
|
|
88
|
-
global.pi.
|
89
|
-
|
90
|
-
|
91
|
-
document.addEventListener("scroll",
|
92
|
-
global.pi.Element.scroll);
|
93
|
-
|
94
|
-
// Apply initial scroll event
|
95
|
-
global.pi.Element.scroll();
|
96
|
-
});
|
88
|
+
if ( typeof global.pi !== 'undefined' && global.document ) {
|
89
|
+
global.pi.Dom.ready(global.pi.Element.listen);
|
90
|
+
}
|
97
91
|
|
98
92
|
export default Pico;
|
package/src/library/element.js
CHANGED
@@ -27,6 +27,15 @@ export class Element
|
|
27
27
|
*/
|
28
28
|
static invi = [];
|
29
29
|
|
30
|
+
static listen()
|
31
|
+
{
|
32
|
+
// Apply dom scroll event
|
33
|
+
document.addEventListener("scroll", Element.scroll);
|
34
|
+
|
35
|
+
// Apply initial scroll event
|
36
|
+
Element.scroll();
|
37
|
+
}
|
38
|
+
|
30
39
|
static scroll()
|
31
40
|
{
|
32
41
|
Arr.each(this.invi, (item, index) => {
|
package/src/library/map.js
CHANGED
@@ -506,7 +506,7 @@ export default class Map
|
|
506
506
|
return boundry;
|
507
507
|
}
|
508
508
|
|
509
|
-
focusMarkers(filter = null, maxZoom = 14)
|
509
|
+
focusMarkers(filter = null, maxZoom = 14, boundSpace = 15)
|
510
510
|
{
|
511
511
|
let boundry = this.getMarkerBoundry(filter);
|
512
512
|
|
@@ -514,7 +514,7 @@ export default class Map
|
|
514
514
|
this.map.setCenter(boundry.getCenter());
|
515
515
|
|
516
516
|
// Adapt viewport to boundry
|
517
|
-
this.map.fitBounds(boundry,
|
517
|
+
this.map.fitBounds(boundry, boundSpace);
|
518
518
|
|
519
519
|
if ( this.map.getZoom() > maxZoom ) {
|
520
520
|
this.map.setZoom(maxZoom);
|