moved view-as to view options, obsolete viewAs()

This commit is contained in:
mig 2017-04-15 10:13:41 +02:00
parent 8b463b27f7
commit 9a3a939c34
2 changed files with 8 additions and 0 deletions

View file

@ -84,6 +84,8 @@ function ReceiveMessage(event)
for(var o in optDefs)
if(typeof options[optDefs[o]]!="undefined")
match.game[o] = options[optDefs[o]];
if(match.game.mViewOptions.switchable)
match.game.mViewAs = options.viewAs;
}
match.game.GameInitView();
match.game.DisplayBoard();

View file

@ -792,6 +792,8 @@
for (var o in optDefs)
if (typeof options[optDefs[o]] != "undefined")
self.game[o] = options[optDefs[o]];
if(options.viewAs && self.game.mViewOptions.switchable)
self.game.mViewAs = options.viewAs;
self.game.GameInitView();
self.game.DisplayBoard();
resolve();
@ -816,6 +818,8 @@
options.showMoves = !!self.game.mShowMoves;
if (self.game.mViewOptions.useAutoComplete)
options.autoComplete = !!self.game.mAutoComplete;
if(self.game.mViewOptions.switchable)
options.viewAs = self.game.mViewAs;
resolve(options);
});
return promise;
@ -920,6 +924,8 @@
if (!this.area && !this.iframe)
return Promise.reject(new Error("viewAs(): match is not attached to DOM element"));
console.warn("Match.viewAs() is obsolete, use Match.setViewOptions() instead");
if (this.game) {
var self = this;