mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-25 19:57:26 -05:00
Support one-panel mode
This commit is contained in:
@@ -428,6 +428,7 @@
|
||||
'change select[name=bg]': 'setBg',
|
||||
'change select[name=timestamps-lobby]': 'setTimestampsLobby',
|
||||
'change select[name=timestamps-pms]': 'setTimestampsPMs',
|
||||
'change select[name=onepanel]': 'setOnePanel',
|
||||
'change input[name=logchat]': 'setLogChat',
|
||||
'change input[name=selfhighlight]': 'setSelfHighlight',
|
||||
'click img': 'avatars'
|
||||
@@ -450,6 +451,10 @@
|
||||
|
||||
buf += '<hr />';
|
||||
buf += '<p><strong>Graphics</strong></p>';
|
||||
var onePanel = !!Tools.prefs('onepanel');
|
||||
if ($(window).width() >= 660) {
|
||||
buf += '<p><label class="optlabel">Layout: <select name="onepanel"><option value=""' + (!onePanel ? ' selected="selected"' : '') + '>◫ Left and right panels</option><option value="1"' + (onePanel ? ' selected="selected"' : '') + '>◻ Single panel</option></select></label></p>';
|
||||
}
|
||||
buf += '<p><label class="optlabel">Background: <button name="background">Change background</button></label></p>';
|
||||
buf += '<p><label class="optlabel"><input type="checkbox" name="dark"' + (Tools.prefs('dark') ? ' checked' : '') + ' /> Dark mode (beta)</label></p>';
|
||||
buf += '<p><label class="optlabel"><input type="checkbox" name="noanim"' + (Tools.prefs('noanim') ? ' checked' : '') + ' /> Disable animations</label></p>';
|
||||
@@ -537,6 +542,11 @@
|
||||
background: function (e) {
|
||||
app.addPopup(CustomBackgroundPopup);
|
||||
},
|
||||
setOnePanel: function (e) {
|
||||
app.singlePanelMode = !!e.currentTarget.value;
|
||||
Tools.prefs('onepanel', !!e.currentTarget.value);
|
||||
app.updateLayout();
|
||||
},
|
||||
setTimestampsLobby: function (e) {
|
||||
this.timestamps.lobby = e.currentTarget.value;
|
||||
Tools.prefs('timestamps', this.timestamps);
|
||||
|
||||
11
js/client.js
11
js/client.js
@@ -432,6 +432,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (Tools.prefs('onepanel')) {
|
||||
self.singlePanelMode = true;
|
||||
self.updateLayout();
|
||||
}
|
||||
|
||||
if (Tools.prefs('bwgfx') || Tools.prefs('noanim')) {
|
||||
// since xy data is loaded by default, only call
|
||||
// loadSpriteData if we want bw sprites or if we need bw
|
||||
@@ -1464,8 +1469,12 @@
|
||||
// If we don't have any right rooms at all, just show the left
|
||||
// room in full. Home is a left room, so we'll always have a
|
||||
// left room.
|
||||
if (!this.sideRoom) {
|
||||
if (!this.sideRoom || this.singlePanelMode) {
|
||||
this.curRoom.show('full');
|
||||
if (this.curSideRoom) {
|
||||
this.curSideRoom.hide();
|
||||
this.curSideRoom = null;
|
||||
}
|
||||
if (this.curRoom.id === '') {
|
||||
if ($(window).width() < this.curRoom.bestWidth) {
|
||||
this.curRoom.$el.addClass('tiny-layout');
|
||||
|
||||
Reference in New Issue
Block a user