return false;
});
+ $(document).on('click touchend', 'a.triggerlink[data-trigger-event="click"]', function () {
+ $this.triggerLinkById($(this).data('trigger-id'));
+ return false;
+ });
+
$(document).on('click touchend', '[data-action]', function () {
var map = {'pdf': 'print', 'fullScreen': "fullscreen", 'locales': 'localesContainers', 'basket': 'cart'};
var action = $(this).data('action');
var $this = this;
$(".contentLink[data-animations]").each(function () {
- $this.animateContentLink($(this));
+ $this.animateContentLink($(this), true);
});
},
- animateContentLink: function (link) {
+ animateContentLink: function (link, autostart) {
+ if ($(link).data('animation-started') === true) {
+ return;
+ }
+ if (autostart === undefined) {
+ autostart = false;
+ }
var animations = $(link).data('animations');
var $this = this;
if (animations.length === 0) {
return;
}
+ if (animations[0]["autostart"] === undefined) {
+ animations[0]["autostart"] = true;
+ }
+ if (animations[0]['autostart'] == '0' || animations[0]['autostart'] == 'false') {
+ animations[0]['autostart'] = false;
+ }
+
+ if (autostart && !animations[0]['autostart']) {
+ return;
+ }
$.each(defaults, function (k, v) {
if (animations[0][v] !== undefined) {
}
});
+ $(link).data('animation-started', true);
+
$.each(animations, function (k, animation) {
$this.executeAnimation(link, $.extend({}, firstDefaults, animation));
});
},
triggerLinkById: function (id) {
- var a = $('.link[data-id="' + id + '"] a:eq(0)');
- a.get(0).click();
+ var link = $('.link[data-id="' + id + '"]');
+
+ if ($(link).is('[data-animations]')) {
+ this.animateContentLink($(link), false);
+ } else {
+ var a = $(link).find('a:eq(0)');
+ a.get(0).click();
+ }
},
initInlineSlideshows: function () {