scratch – Blame information for rev 117
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
117 | office | 1 | /*=========================== |
2 | Add .swiper plugin from Dom libraries |
||
3 | ===========================*/ |
||
4 | function addLibraryPlugin(lib) { |
||
5 | lib.fn.swiper = function (params) { |
||
6 | var firstInstance; |
||
7 | lib(this).each(function () { |
||
8 | var s = new Swiper(this, params); |
||
9 | if (!firstInstance) firstInstance = s; |
||
10 | }); |
||
11 | return firstInstance; |
||
12 | }; |
||
13 | } |
||
14 | |||
15 | if (domLib) { |
||
16 | if (!('transitionEnd' in domLib.fn)) { |
||
17 | domLib.fn.transitionEnd = function (callback) { |
||
18 | var events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'], |
||
19 | i, j, dom = this; |
||
20 | function fireCallBack(e) { |
||
21 | /*jshint validthis:true */ |
||
22 | if (e.target !== this) return; |
||
23 | callback.call(this, e); |
||
24 | for (i = 0; i < events.length; i++) { |
||
25 | dom.off(events[i], fireCallBack); |
||
26 | } |
||
27 | } |
||
28 | if (callback) { |
||
29 | for (i = 0; i < events.length; i++) { |
||
30 | dom.on(events[i], fireCallBack); |
||
31 | } |
||
32 | } |
||
33 | return this; |
||
34 | }; |
||
35 | } |
||
36 | if (!('transform' in domLib.fn)) { |
||
37 | domLib.fn.transform = function (transform) { |
||
38 | for (var i = 0; i < this.length; i++) { |
||
39 | var elStyle = this[i].style; |
||
40 | elStyle.webkitTransform = elStyle.MsTransform = elStyle.msTransform = elStyle.MozTransform = elStyle.OTransform = elStyle.transform = transform; |
||
41 | } |
||
42 | return this; |
||
43 | }; |
||
44 | } |
||
45 | if (!('transition' in domLib.fn)) { |
||
46 | domLib.fn.transition = function (duration) { |
||
47 | if (typeof duration !== 'string') { |
||
48 | duration = duration + 'ms'; |
||
49 | } |
||
50 | for (var i = 0; i < this.length; i++) { |
||
51 | var elStyle = this[i].style; |
||
52 | elStyle.webkitTransitionDuration = elStyle.MsTransitionDuration = elStyle.msTransitionDuration = elStyle.MozTransitionDuration = elStyle.OTransitionDuration = elStyle.transitionDuration = duration; |
||
53 | } |
||
54 | return this; |
||
55 | }; |
||
56 | } |
||
57 | if (!('outerWidth' in domLib.fn)) { |
||
58 | domLib.fn.outerWidth = function (includeMargins) { |
||
59 | if (this.length > 0) { |
||
60 | if (includeMargins) |
||
61 | return this[0].offsetWidth + parseFloat(this.css('margin-right')) + parseFloat(this.css('margin-left')); |
||
62 | else |
||
63 | return this[0].offsetWidth; |
||
64 | } |
||
65 | else return null; |
||
66 | }; |
||
67 | } |
||
68 | } |