Skip to content

Commit d403b74

Browse files
committed
Add bundle for release 2.0.14
1 parent fdd82df commit d403b74

File tree

1 file changed

+54
-21
lines changed

1 file changed

+54
-21
lines changed

bundle.js

+54-21
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Patternslib 2.0.13
1+
// Patternslib 2.0.14
22

33
/**
44
* @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
@@ -12732,9 +12732,9 @@ define('pat-logger',[
1273212732

1273312733
define('pat-utils',[
1273412734
"jquery",
12735-
"jquery.browser",
12736-
"underscore"
12737-
], function($) {
12735+
"underscore",
12736+
"jquery.browser" // adds itself to the jquery object, no need to pass to the define callback.
12737+
], function($, _) {
1273812738

1273912739
$.fn.safeClone = function () {
1274012740
var $clone = this.clone();
@@ -14342,7 +14342,7 @@ define('pat-parser',[
1434214342
if (!part) { return; }
1434314343
var matches = part.match(this.named_param_pattern);
1434414344
if (!matches) {
14345-
this.log.warn("Invalid parameter: " + part);
14345+
this.log.warn("Invalid parameter: " + part + ": " + argstring);
1434614346
return;
1434714347
}
1434814348
var name = matches[1],
@@ -18433,8 +18433,7 @@ define('pat-store',[],function() {
1843318433
}
1843418434
}
1843518435
return options;
18436-
},
18437-
18436+
}
1843818437
};
1843918438

1844018439
// Perform the test separately since this may throw a SecurityError as
@@ -30830,7 +30829,8 @@ define('pat-inject',[
3083030829
formaction = $button.attr("formaction"),
3083130830
$form = $button.parents(".pat-inject").first(),
3083230831
opts = {url: formaction},
30833-
cfgs = inject.extractConfig($form, opts);
30832+
$cfg_node = $button.closest("[data-pat-inject]"),
30833+
cfgs = inject.extractConfig($cfg_node, opts);
3083430834

3083530835
ev.preventDefault();
3083630836
$form.trigger("patterns-inject-triggered");
@@ -38333,7 +38333,10 @@ define('pat-modal',[
3833338333

3833438334
// Restore focus in case the active element was a child of $el and
3833538335
// the focus was lost during the wrapping.
38336-
document.activeElement.focus();
38336+
// Only if we have an activeElement, as IE10/11 can have undefined as activeElement
38337+
if (document.activeElement) {
38338+
document.activeElement.focus();
38339+
}
3833738340
this._init_handlers();
3833838341
this.resize();
3833938342
this.setPosition();
@@ -43698,7 +43701,7 @@ define("pat-gallery", [
4369843701
});
4369943702
gallery.init();
4370043703
});
43701-
},
43704+
}
4370243705
});
4370343706
});
4370443707

@@ -50796,8 +50799,9 @@ define('pat-scroll',[
5079650799
"pat-utils",
5079750800
"pat-logger",
5079850801
"pat-parser",
50799-
"underscore"
50800-
], function($, patterns, Base, utils, logging, Parser, _) {
50802+
"underscore",
50803+
"imagesloaded"
50804+
], function($, patterns, Base, utils, logging, Parser, _, imagesLoaded) {
5080150805
var log = logging.getLogger("scroll"),
5080250806
parser = new Parser("scroll");
5080350807
parser.addArgument("trigger", "click", ["click", "auto"]);
@@ -50813,7 +50817,11 @@ define('pat-scroll',[
5081350817
init: function($el, opts) {
5081450818
this.options = parser.parse(this.$el, opts);
5081550819
if (this.options.trigger == "auto") {
50816-
this.smoothScroll();
50820+
// Only calculate the offset when all images are loaded
50821+
var that = this;
50822+
$('body').imagesLoaded( function() {
50823+
that.smoothScroll();
50824+
});
5081750825
} else if (this.options.trigger == "click") {
5081850826
this.$el.click(this.onClick.bind(this));
5081950827
}
@@ -50909,15 +50917,40 @@ define('pat-scroll',[
5090950917
$el = this.options.selector ? $(this.options.selector) : this.$el;
5091050918
options[scroll] = this.options.offset;
5091150919
} else {
50912-
$el = $('body, html');
50913-
options[scroll] = $(this.$el.attr('href')).offset().top;
50914-
}
50915-
$el.animate(options, {
50916-
duration: 500,
50917-
start: function() {
50918-
$('.pat-scroll').addClass('pat-scroll-animated');
50920+
// Get the first element with overflow auto starting from the trigger
50921+
// (the scroll container)
50922+
// Then calculate the offset relatively to that container
50923+
$el = $(this.$el.parents()
50924+
.filter(function() {
50925+
return $(this).css('overflow') === 'auto'; })
50926+
.first())
50927+
if (typeof $el[0] === 'undefined') {
50928+
$el = $('html, body');
50929+
}
50930+
50931+
var scroll_container = Math.floor( $el.offset().top );
50932+
var target = Math.floor( $(this.$el.attr('href')).offset().top );
50933+
50934+
if (target == scroll_container) {
50935+
options[scroll] = scroll_container;
50936+
} else if (target >= scroll_container) {
50937+
options[scroll] = target - scroll_container;
50938+
$el.animate(options, {
50939+
duration: 500,
50940+
start: function() {
50941+
$('.pat-scroll').addClass('pat-scroll-animated');
50942+
}
50943+
});
50944+
} else {
50945+
options[scroll] = target + scroll_container ;
50946+
$el.animate(options, {
50947+
duration: 500,
50948+
start: function() {
50949+
$('.pat-scroll').addClass('pat-scroll-animated');
50950+
}
50951+
});
5091950952
}
50920-
});
50953+
}
5092150954
}
5092250955
});
5092350956
});

0 commit comments

Comments
 (0)