Add 'sidebaropened: pinned' option to allow sidebar to be pre-pinned but support unpinning

This commit is contained in:
Mike Primm 2011-08-29 21:00:05 -05:00
parent 974cd33853
commit 7e37817b86
3 changed files with 11 additions and 6 deletions

View File

@ -20,7 +20,7 @@ public class ClientConfigurationComponent extends Component {
s(t, "spammessage", c.getString("spammessage", "You may only chat once every %interval% seconds."));
s(t, "webprefix", unescapeString(c.getString("webprefix", "[WEB] ")));
s(t, "defaultzoom", c.getInteger("defaultzoom", 0));
s(t, "sidebaropened", c.getBoolean("sidebaropened", false));
s(t, "sidebaropened", c.getString("sidebaropened", "false"));
DynmapWorld defaultWorld = null;
String defmap = null;

View File

@ -260,7 +260,7 @@ updaterate: 2000
showplayerfacesinmenu: true
# Set sidebaropened: true to pin menu sidebar opened
# Set sidebaropened: 'true' to pin menu sidebar opened permanently, 'pinned' to default the sidebar to pinned, but allow it to unpin
#sidebaropened: true
joinmessage: "%playername% joined"

View File

@ -145,10 +145,15 @@ DynMap.prototype = {
var panel;
var sidebar;
var pinbutton;
if(!me.options.sidebaropened) {
if(me.options.sidebaropened != 'true') { // false or pinned
var pincls = 'pinned'
if(me.options.sidebaropened == 'false')
pincls = '';
sidebar = me.sidebar = $('<div/>')
.addClass('sidebar')
.appendTo(container);
.addClass('sidebar ' + pincls)
.appendTo(container);
panel = $('<div/>')
.addClass('panel')
@ -271,7 +276,7 @@ DynMap.prototype = {
.append(link=$('<input type="text" />'))
.data('link', link)
.appendTo(container);*/
if(!me.options.sidebaropened) {
if(me.options.sidebaropened != 'true') {
$('<div/>')
.addClass('hitbar')
.appendTo(panel);