1
|
|
|
;(function($, window, document) { |
|
|
|
|
2
|
|
|
'use strict'; |
3
|
|
|
|
4
|
|
|
$.plugin('dnOffCanvasVariantSwitch', { |
5
|
|
|
|
6
|
|
|
defaults: { |
7
|
|
|
url: '', |
8
|
|
|
basketId: 0, |
9
|
|
|
articleId: 0, |
10
|
|
|
number: '', |
11
|
|
|
quantity: 0, |
12
|
|
|
offCanvas: false |
13
|
|
|
}, |
14
|
|
|
|
15
|
|
|
init: function () { |
16
|
|
|
var me = this; |
17
|
|
|
|
18
|
|
|
me.applyDataAttributes(); |
19
|
|
|
|
20
|
|
|
$.ajax({ |
21
|
|
|
data: me.opts, |
22
|
|
|
url: me.opts.url, |
23
|
|
|
type: "GET", |
24
|
|
|
dataType: "html", |
25
|
|
|
success: function (response) { |
26
|
|
|
me.$el.html(response); |
27
|
|
|
|
28
|
|
|
window.StateManager.addPlugin( |
29
|
|
|
'*[data-variant-switch="true"]', |
30
|
|
|
'dnVariantSwitch', |
31
|
|
|
['xs', 's', 'm', 'l', 'xl'] |
32
|
|
|
); |
33
|
|
|
} |
34
|
|
|
}); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
}); |
38
|
|
|
|
39
|
|
|
$.subscribe("plugin/swCollapseCart/onLoadCartFinished", function() { |
40
|
|
|
window.StateManager.addPlugin( |
41
|
|
|
'*[data-off-canvas-variant-switch="true"]', |
42
|
|
|
'dnOffCanvasVariantSwitch', |
43
|
|
|
['xs', 's', 'm', 'l', 'xl'] |
44
|
|
|
); |
45
|
|
|
}); |
46
|
|
|
|
47
|
|
|
$.subscribe("plugin/swCollapseCart/onArticleAdded", function() { |
48
|
|
|
window.StateManager.addPlugin( |
49
|
|
|
'*[data-off-canvas-variant-switch="true"]', |
50
|
|
|
'dnOffCanvasVariantSwitch', |
51
|
|
|
['xs', 's', 'm', 'l', 'xl'] |
52
|
|
|
); |
53
|
|
|
}); |
54
|
|
|
|
55
|
|
|
$.subscribe("plugin/swCollapseCart/onRemoveArticleFinished", function() { |
56
|
|
|
window.StateManager.addPlugin( |
57
|
|
|
'*[data-off-canvas-variant-switch="true"]', |
58
|
|
|
'dnOffCanvasVariantSwitch', |
59
|
|
|
['xs', 's', 'm', 'l', 'xl'] |
60
|
|
|
); |
61
|
|
|
}); |
62
|
|
|
|
63
|
|
|
})(jQuery, window); |
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.