Skip to content

Instantly share code, notes, and snippets.

@shinigamicorei7
Created May 15, 2015 18:51
Show Gist options
  • Save shinigamicorei7/3f0d16190ad6cf7034b1 to your computer and use it in GitHub Desktop.
Save shinigamicorei7/3f0d16190ad6cf7034b1 to your computer and use it in GitHub Desktop.
(function () {
var MatrixDevelopmentsApp;
MatrixDevelopmentsApp = function () {
this.init = [];
this.plugins = {};
this.settings = {};
this.localStorageSupported = typeof window.Storage !== "undefined" ? true : false;
return this;
};
MatrixDevelopmentsApp.prototype.start = function (init, settings) {
if (init == null) {
init = [];
}
if (settings == null) {
settings = {};
}
window.onload = (function (_this) {
return function () {
var initilizer, _i, _len, _ref;
$('html').addClass('pxajs');
if (init.length > 0) {
$.merge(_this.init, init);
}
_this.settings = $.extend(true, {}, settings || {});
_this.settings.is_mobile = /iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase());
if (_this.settings.is_mobile) {
if (FastClick) {
FastClick.attach(document.body);
}
}
_ref = _this.init;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
initilizer = _ref[_i];
$.proxy(initilizer, _this)();
}
$(window).trigger("pa.loaded");
return $(window).resize();
};
})(this);
return this;
};
MatrixDevelopmentsApp.Constructor = MatrixDevelopmentsApp;
window.MatrixDevelopments = new MatrixDevelopmentsApp;
}).call(this);
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment