mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 04:59:21 +03:00
Code refactoring (es5 -> es2015)
This commit is contained in:
parent
fb2e492ce8
commit
38a1041a73
42 changed files with 3081 additions and 3690 deletions
|
|
@ -1,41 +0,0 @@
|
|||
|
||||
var
|
||||
_ = require('_'),
|
||||
|
||||
Utils = require('Common/Utils');
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {string} sModelName
|
||||
*/
|
||||
function AbstractModel(sModelName)
|
||||
{
|
||||
this.sModelName = sModelName || '';
|
||||
this.disposables = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array|Object} mInputValue
|
||||
*/
|
||||
AbstractModel.prototype.regDisposables = function(mInputValue)
|
||||
{
|
||||
if (Utils.isArray(mInputValue))
|
||||
{
|
||||
_.each(mInputValue, function(mValue) {
|
||||
this.disposables.push(mValue);
|
||||
}, this);
|
||||
}
|
||||
else if (mInputValue)
|
||||
{
|
||||
this.disposables.push(mInputValue);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
AbstractModel.prototype.onDestroy = function()
|
||||
{
|
||||
Utils.disposeObject(this);
|
||||
};
|
||||
|
||||
module.exports = AbstractModel;
|
||||
Loading…
Add table
Add a link
Reference in a new issue