Browse Source

Add RATCHET namespace to Ratchet

pull/745/head
Johann-S 10 years ago
parent
commit
3c117e77a4
  1. 9
      js/common.js
  2. 3
      js/push.js
  3. 4
      js/sliders.js
  4. 2
      js/toggles.js

9
js/common.js

@ -9,8 +9,13 @@
!(function () { !(function () {
'use strict'; 'use strict';
// Create Ratchet namespace
if (typeof window.RATCHET === 'undefined') {
window.RATCHET = {};
}
// Original script from http://davidwalsh.name/vendor-prefix // Original script from http://davidwalsh.name/vendor-prefix
var getBrowserCapabilities = (function () { window.RATCHET.getBrowserCapabilities = (function () {
var styles = window.getComputedStyle(document.documentElement, ''); var styles = window.getComputedStyle(document.documentElement, '');
var pre = (Array.prototype.slice var pre = (Array.prototype.slice
.call(styles) .call(styles)
@ -22,6 +27,4 @@
transform: pre[0].toUpperCase() + pre.substr(1) + 'Transform' transform: pre[0].toUpperCase() + pre.substr(1) + 'Transform'
}; };
})(); })();
window.getBrowserCapabilities = getBrowserCapabilities;
}()); }());

3
js/push.js

@ -502,6 +502,9 @@
} }
}); });
window.addEventListener('popstate', popstate); window.addEventListener('popstate', popstate);
// TODO : Remove this line in the next major version
window.PUSH = PUSH; window.PUSH = PUSH;
window.RATCHET.push = PUSH;
}()); }());

4
js/sliders.js

@ -25,8 +25,8 @@
var scrollableArea; var scrollableArea;
var startedMoving; var startedMoving;
var transformPrefix = window.getBrowserCapabilities.prefix; var transformPrefix = window.RATCHET.getBrowserCapabilities.prefix;
var transformProperty = window.getBrowserCapabilities.transform; var transformProperty = window.RATCHET.getBrowserCapabilities.transform;
var getSlider = function (target) { var getSlider = function (target) {
var i; var i;

2
js/toggles.js

@ -14,7 +14,7 @@
var touchMove = false; var touchMove = false;
var distanceX = false; var distanceX = false;
var toggle = false; var toggle = false;
var transformProperty = window.getBrowserCapabilities.transform; var transformProperty = window.RATCHET.getBrowserCapabilities.transform;
var findToggle = function (target) { var findToggle = function (target) {
var i; var i;

Loading…
Cancel
Save