|
From: <pe...@us...> - 2012-08-09 19:59:31
|
Revision: 931
http://openautomation.svn.sourceforge.net/openautomation/?rev=931&view=rev
Author: peuter
Date: 2012-08-09 19:59:24 +0000 (Thu, 09 Aug 2012)
Log Message:
-----------
necessary changes for the new metal-design:
- add active-class to pagejumps if the referred page is currently shown
- possibility to use the page-name for the pagejump target
- possiblility to set the navbar width in the config file
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/structure/pure/navbar.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-08-09 19:54:52 UTC (rev 930)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-08-09 19:59:24 UTC (rev 931)
@@ -549,6 +549,15 @@
function scrollToPage( page_id, speed ) {
$('.activePage').removeClass('activePage');
+ $('.pagejump.active').removeClass('active');
+ if (page_id.match(/^[0-9_]+$/)==null) {
+ // find Page-ID by name
+ $('.page h1').each(function(i) {
+ if ($(this).text()==page_id) {
+ page_id = $(this).closest(".page").attr('id');
+ }
+ });
+ }
$('#'+page_id).addClass('pageActive activePage'); // show new page
$('#'+page_id+'_navbar').addClass('navbarActive');
@@ -577,6 +586,19 @@
refreshDiagram(pagedivs[i]);
}
}
+ // set pagejump for this page to active if it exists
+ $(".pagejump > .actor").each(function (i) {
+ var data = $(this).data();
+ if (data.target.match(/^[0-9_]+$/)==null) {
+ // get page id by name
+ if ($('#'+page_id+' h1').text()==data.target) {
+ $(this).parent().addClass("active");
+ }
+ }
+ else if (page_id==data.target) {
+ $(this).parent().addClass("active");
+ }
+ });
}
function updateTopNavigation() {
Modified: CometVisu/trunk/visu/structure/pure/navbar.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/navbar.js 2012-08-09 19:54:52 UTC (rev 930)
+++ CometVisu/trunk/visu/structure/pure/navbar.js 2012-08-09 19:59:24 UTC (rev 931)
@@ -28,6 +28,7 @@
var dynamic = $n.attr('dynamic') == 'true' ? true : false;
var position = $n.attr('position') || 'left';
+ var size = $n.attr('width') || 300;
switch( position )
{
case 'top':
@@ -36,13 +37,13 @@
case 'left':
$('#navbarLeft').append( container );
- var thisSize = $('#navbarLeft').data('size') || 300; // FIXME - only a temporal solution
+ var thisSize = $('#navbarLeft').data('size') || size; // FIXME - only a temporal solution
if( dynamic ) navbarSetSize( 'left', thisSize );
break;
case 'right':
$('#navbarRight').append( container );
- var thisSize = $('#navbarRight').data('size') || 300; // FIXME - only a temporal solution
+ var thisSize = $('#navbarRight').data('size') || size; // FIXME - only a temporal solution
if( dynamic ) navbarSetSize( 'right', thisSize );
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|