air-datepicker/js/datepicker/datepicker.js
2015-09-26 17:25:04 +03:00

33 lines
836 B
JavaScript

;(function () {
var pluginName = 'datepicker';
function Datepicker () {
}
Datepicker.prototype = {
init: function () {
}
};
$.fn[pluginName] = function ( options ) {
if (Datepicker.prototype[options]) {
Datepicker.prototype[options].apply(this.data(pluginName), Array.prototype.slice.call(arguments, 1));
} else {
return this.each(function () {
if (!$.data(this, pluginName)) {
$.data(this, pluginName,
new Datepicker( this, options ));
} else {
var _this = $.data(this, pluginName),
oldOpts = _this.opts;
_this.opts = $.extend({}, oldOpts, options);
}
});
}
};
})();