Skip to content

Instantly share code, notes, and snippets.

@lomadurov
Last active August 29, 2015 14:11
Show Gist options
  • Save lomadurov/a99a514718d9f3a693d9 to your computer and use it in GitHub Desktop.
Save lomadurov/a99a514718d9f3a693d9 to your computer and use it in GitHub Desktop.
var _ = require('_'),
$ = require('jquery');
var Calendar = function (el) {
// init
this.create();
}
_.extend(Calendar.protorype, {
_shown: false,
create: function () {
// do something
return this.render();
},
render: function () {
// do something
return this;
}
});
module.exports = function (el) {
return new Calendar(el);
}
//********************************************//
// Для доступа из другого модуля
//********************************************//
var Сalendar = require('calendar'),
calendar = Calendar('#el');
// Или упрошённый вариант
var calendar = require('calendar')('#el');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment