Skip to content
Permalink
Browse files

mode switcher position

  • Loading branch information...
michmech committed Oct 14, 2017
1 parent 07f0b98 commit 79200fabaadb429e95edb724e92593d5abde57ff
Showing with 11 additions and 6 deletions.
  1. BIN cog.png
  2. BIN sitemap.png
  3. BIN tag.png
  4. +9 −3 xonomy.css
  5. +2 −3 xonomy.js
BIN -512 Bytes cog.png
Binary file not shown.
BIN +278 Bytes sitemap.png
Binary file not shown.
BIN +389 Bytes tag.png
Binary file not shown.
@@ -410,6 +410,12 @@
.xonomy .inlinecaption a { color: inherit; text-decoration: none; }
.xonomy .inlinecaption a:hover {color: #2d4ea1;}

.xonomy div.modeSwitcher { position: fixed; bottom: 15px; right: 15px; width: 30px; height: 30px; background-color: #ffffff; background-image: url(cog.png); background-position: center center; background-repeat: no-repeat; border-radius: 4px; cursor: pointer; box-shadow: 0px 0px 1px #999999; z-index: 12;}
.xonomy div.modeSwitcher:hover {background-color: #fcfcd2; box-shadow: 0px 0px 2px #999999; }
.xonomy div.modeSwitcher:active {box-shadow: inset 0px 0px 2px #999999; }
.xonomy div.modeSwitcher { position: fixed; bottom: 0px; left: 0px; width: 70px; height: 28px; background-color: #ffffff; cursor: pointer; border: 1px solid #cccccc; z-index: 12;}
.xonomy.nerd div.modeSwitcher {}
.xonomy.laic div.modeSwitcher {}
.xonomy div.modeSwitcher span.nerd {display: inline-block; width: 35px; height: 28px; background-image: url(tag.png); background-position: center center; background-repeat: no-repeat; }
.xonomy div.modeSwitcher span.laic {display: inline-block; width: 35px; height: 28px; background-image: url(sitemap.png); background-position: center center; background-repeat: no-repeat; }
.xonomy div.modeSwitcher span {background-color: #f3f3f3;}
.xonomy div.modeSwitcher:hover {box-shadow: 0px 0px 1px #999999; }
.xonomy.nerd div.modeSwitcher span.nerd {background-color: #fbeb93; }
.xonomy.laic div.modeSwitcher span.laic {background-color: #fbeb93; }
@@ -441,10 +441,9 @@ Xonomy.render=function(data, editor, docSpec) { //renders the contents of an edi
$(editor).hide();
editor.innerHTML=Xonomy.renderElement(data, editor);
$(editor).show();

if(docSpec.allowModeSwitching){
$("<div class='modeSwitcher'></div>").appendTo($(editor)).on("click", function(e){
if(Xonomy.mode=="nerd") Xonomy.setMode("laic"); else Xonomy.setMode("nerd");
$("<div class='modeSwitcher'><span class='nerd'></span><span class='laic'></span></div>").appendTo($(editor)).on("click", function(e){
if(Xonomy.mode=="nerd") { Xonomy.setMode("laic"); } else { Xonomy.setMode("nerd"); }
if(docSpec.onModeSwitch) docSpec.onModeSwitch(Xonomy.mode);
});
}

0 comments on commit 79200fa

Please sign in to comment.
You can’t perform that action at this time.