This commit is contained in:
Ilya Kantor 2016-11-14 16:31:21 +03:00
parent 3defacc09d
commit f99574f53b
178 changed files with 530 additions and 271 deletions

View file

@ -0,0 +1,28 @@
function Menu(state) {
this._state = state || Menu.STATE_CLOSED;
};
Menu.STATE_OPEN = 1;
Menu.STATE_CLOSED = 0;
Menu.prototype.open = function() {
this._state = Menu.STATE_OPEN;
};
Menu.prototype.close = function() {
this._state = Menu.STATE_CLOSED;
};
Menu.prototype._stateAsString = function() {
switch (this._state) {
case Menu.STATE_OPEN:
return 'открыто';
case Menu.STATE_CLOSED:
return 'закрыто';
}
};
Menu.prototype.showState = function() {
alert(this._stateAsString());
};