Merge pull request #641 from 0ip/highlight_module

Fix | Highlight currently opened module
pull/649/merge
John McLear 2012-04-19 08:23:51 -07:00
commit 9fe8a7530d
2 changed files with 150 additions and 152 deletions

View File

@ -182,7 +182,7 @@ var padeditbar = (function()
//hide all modules
if(moduleName == "none")
{
$("#editbar ul#menu_right > li").removeClass("selected");
$(".toolbar ul.menu_right li").removeClass("selected");
for(var i=0;i<modules.length;i++)
{
//skip the userlist
@ -201,10 +201,10 @@ var padeditbar = (function()
{
var nth_child = indexOf(modules, moduleName) + 1;
if (nth_child > 0 && nth_child <= (modules.length-1)) {
$("#editbar ul#menu_right li:not(:nth-child(" + nth_child + "))").removeClass("selected");
$("#editbar ul#menu_right li:nth-child(" + nth_child + ")").toggleClass("selected");
$(".toolbar ul.menu_right li:not(:nth-child(" + nth_child + "))").removeClass("selected");
$(".toolbar ul.menu_right li:nth-child(" + nth_child + ")").toggleClass("selected");
}
if(modules[modules.length-1] === moduleName) $("#editbar ul#menu_right li").removeClass("selected");
if(modules[modules.length-1] === moduleName) $(".toolbar ul.menu_right li").removeClass("selected");
//hide all modules that are not selected and show the selected one
for(var i=0;i<modules.length;i++)
{

View File

@ -61,19 +61,17 @@
</ul>
<ul class="menu_right">
<% e.begin_block("editbarMenuRight"); %>
<li onClick="window.pad&amp;&amp;pad.editbarClick('savedRevision');return false;">
<a id="settingslink" title="Mark this revision as a saved revision">
<div class="buttonicon buttonicon-savedRevision"></div>
</a>
</li>
<li id="settingslink" onClick="window.pad&amp;&amp;pad.editbarClick('settings');return false;">
<a class="buttonicon buttonicon-settings" id="settingslink" title="Settings of this pad"></a>
<a class="buttonicon buttonicon-settings" title="Settings of this pad"></a>
</li>
<li id="importexportlink" onClick="window.pad&amp;&amp;pad.editbarClick('import_export');return false;">
<a class="buttonicon buttonicon-import_export" id="exportlink" title="Import/Export from/to different document formats"></a>
<a class="buttonicon buttonicon-import_export" title="Import/Export from/to different document formats"></a>
</li>
<li id="embedlink" onClick="window.pad&amp;&amp;pad.editbarClick('embed');return false;" >
<a class="buttonicon buttonicon-embed" id="embedlink" title="Share and Embed this pad"></a>
<li id="embedlink" onClick="window.pad&amp;&amp;pad.editbarClick('embed');return false;">
<a class="buttonicon buttonicon-embed" title="Share and Embed this pad"></a>
</li>
<li id="revisionlink" onClick="window.pad&amp;&amp;pad.editbarClick('savedRevision');return false;">
<a class="buttonicon buttonicon-savedRevision" title="Mark this revision as a saved revision"></a>
</li>
<li class="separator"></li>
<li id="timesliderlink" onClick="document.location = document.location.pathname+ '/timeslider'">