mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 17:58:41 +00:00
35 lines
743 B
JavaScript
35 lines
743 B
JavaScript
(function (jsOMS) {
|
|
"use strict";
|
|
|
|
jsOMS.ViewAbstract = class {
|
|
constructor ()
|
|
{
|
|
this.element = null;
|
|
this.data = [];
|
|
};
|
|
|
|
bind (node)
|
|
{
|
|
this.element = node;
|
|
};
|
|
|
|
addData(id, data, overwrite)
|
|
{
|
|
overwrite = typeof overwrite !== 'undefined' ? overwrite : false;
|
|
|
|
if (typeof this.data[id] === 'undefined' || overwrite) {
|
|
this.data[id] = data;
|
|
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
};
|
|
|
|
getData(id)
|
|
{
|
|
return typeof this.data[id] !== 'undefined' ? this.data[id] : undefined;
|
|
};
|
|
}
|
|
}(window.jsOMS = window.jsOMS || {}));
|