eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ji...@apache.org
Subject eagle git commit: [EAGLE-864] Make sure "HBase" nav active in sidebar when visiting through URL
Date Tue, 14 Feb 2017 03:15:04 GMT
Repository: eagle
Updated Branches:
  refs/heads/master efeda2008 -> f9bce3084


[EAGLE-864] Make sure "HBase" nav active in sidebar when visiting through URL

 - When active submenu  then it's parent menu will active also.

https://issues.apache.org/jira/browse/EAGLE-864

Author: r7raul1984 <tangjijun@yhd.com>

Closes #798 from r7raul1984/EAGLE-864.


Project: http://git-wip-us.apache.org/repos/asf/eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/eagle/commit/f9bce308
Tree: http://git-wip-us.apache.org/repos/asf/eagle/tree/f9bce308
Diff: http://git-wip-us.apache.org/repos/asf/eagle/diff/f9bce308

Branch: refs/heads/master
Commit: f9bce30848b5bb688d9ec264e5bdb160b610a18f
Parents: efeda20
Author: r7raul1984 <tangjijun@yhd.com>
Authored: Tue Feb 14 11:14:55 2017 +0800
Committer: zombieJ <smith3816@gmail.com>
Committed: Tue Feb 14 11:14:55 2017 +0800

----------------------------------------------------------------------
 eagle-server/src/main/webapp/app/dev/index.html     |  2 +-
 .../src/main/webapp/app/dev/public/js/app.js        | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/eagle/blob/f9bce308/eagle-server/src/main/webapp/app/dev/index.html
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/dev/index.html b/eagle-server/src/main/webapp/app/dev/index.html
index 26b12ee..b4dfea6 100644
--- a/eagle-server/src/main/webapp/app/dev/index.html
+++ b/eagle-server/src/main/webapp/app/dev/index.html
@@ -130,7 +130,7 @@
 				<!-- side bar: style can be found in sidebar.less -->
 				<section class="sidebar">
 					<ul class="sidebar-menu">
-						<li ng-repeat="portal in Portal.list track by $index" ng-class="{treeview: portal.list}"
ng-if="portal.showFunc ? portal.showFunc() : true">
+						<li ng-repeat="portal in Portal.list track by $index" ng-class="{treeview: portal.list
, active: getPageNavClass(portal.list)}" ng-if="portal.showFunc ? portal.showFunc() : true">
 							<a ng-href="{{portal.path}}">
 								<i class="fa fa-{{portal.icon || 'circle-o'}}"></i>
 								<span>{{portal.name}}</span>

http://git-wip-us.apache.org/repos/asf/eagle/blob/f9bce308/eagle-server/src/main/webapp/app/dev/public/js/app.js
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/dev/public/js/app.js b/eagle-server/src/main/webapp/app/dev/public/js/app.js
index 79c2df5..f28f362 100644
--- a/eagle-server/src/main/webapp/app/dev/public/js/app.js
+++ b/eagle-server/src/main/webapp/app/dev/public/js/app.js
@@ -324,6 +324,22 @@ var app = {};
 			});
 
 			// ================================ Function ================================
+			// Get Page class by submenu
+			$scope.getPageNavClass = function (subportals) {
+				var classname = "";
+				if (typeof subportals === 'undefined') {
+					return "";
+				}
+				$.each(subportals, function (i) {
+					if (classname === "active") {
+						return;
+					}
+					classname = $scope.getNavClass(subportals[i]);
+				});
+				return classname;
+
+			};
+
 			// Get side bar navigation item class
 			$scope.getNavClass = function (portal) {
 				var path = (portal.path || "").replace(/^#/, '');


Mime
View raw message