Merge "Update UI-Router"

This commit is contained in:
Zuul 2018-02-14 20:41:08 +00:00 committed by Gerrit Code Review
commit 4ae1e12745
5 changed files with 22 additions and 15 deletions

View File

@ -63,6 +63,7 @@
"selenium-standalone": "2.43.1-2.9.0-1"
},
"dependencies": {
"@uirouter/angularjs": "^1.0.12",
"angular": "1.5.8",
"angular-cache": "https://github.com/jmdobry/angular-cache/archive/3.2.5.tar.gz",
"angular-elastic": "https://github.com/monospaced/angular-elastic/archive/v2.4.2.tar.gz",
@ -73,7 +74,6 @@
"angular-sanitize": "1.5.8",
"angular-scenario": "1.5.8",
"angular-bootstrap": "0.12.2",
"angular-ui-router": "0.2.13",
"angularjs-viewhead": "0.0.1",
"bootstrap": "3.3.7",
"font-awesome": "4.5.0",

View File

@ -19,7 +19,7 @@
* sets global scope variable accordingly.
*/
angular.module('storyboard').controller('ApplicationController',
function ($scope, $state, $rootScope) {
function ($scope, $state, $rootScope, $transitions) {
'use strict';
/**
@ -46,7 +46,7 @@ angular.module('storyboard').controller('ApplicationController',
* Listen to changes in the state machine to trigger our submenu
* scan.
*/
$rootScope.$on('$stateChangeSuccess',
$transitions.onSuccess({},
function () {
$scope.hasSubmenu = hasSubmenu($state.$current);
});

View File

@ -22,7 +22,7 @@
* @author Michael Krotscheck
*/
angular.module('sb.util').directive('activePath',
function ($location, $rootScope) {
function ($location, $rootScope, $transitions) {
'use strict';
return {
@ -40,7 +40,12 @@ angular.module('sb.util').directive('activePath',
// binding will return a function that will disconnect
// that binding.
var disconnectBinding =
$rootScope.$on('$stateChangeSuccess', setActivePath);
$transitions.onSuccess({}, function setActivePath() {
var path = $location.path();
var isMatchedPath = path.match(activePath) !== null;
element.toggleClass('active', isMatchedPath);
});
$scope.$on('$destroy', disconnectBinding);
// INIT

View File

@ -31,7 +31,7 @@
<script src="angular/angular.js"></script>
<script src="angular-elastic/elastic.js"></script>
<script src="angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="angular-ui-router/release/angular-ui-router.js"></script>
<script src="@uirouter/angularjs/release/angular-ui-router.js"></script>
<script src="angular-resource/angular-resource.js"></script>
<script src="angular-local-storage/dist/angular-local-storage.js"></script>
<script src="angular-sanitize/angular-sanitize.js"></script>

View File

@ -2,6 +2,16 @@
# yarn lockfile v1
"@uirouter/angularjs@^1.0.12":
version "1.0.12"
resolved "https://registry.yarnpkg.com/@uirouter/angularjs/-/angularjs-1.0.12.tgz#b2275b7e33e0024a485f96568a18d350539880f3"
dependencies:
"@uirouter/core" "5.0.13"
"@uirouter/core@5.0.13":
version "5.0.13"
resolved "https://registry.yarnpkg.com/@uirouter/core/-/core-5.0.13.tgz#e1b31626c393cbdd82651755ff1ce3fc55163fd0"
abbrev@1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
@ -122,18 +132,10 @@ angular-scenario@1.5.8:
version "0.12.0"
resolved "https://github.com/angular-ui/bootstrap/archive/0.12.0.tar.gz#479e5c7d9ef75d6133f68143b96948f8e77136b2"
angular-ui-router@0.2.13:
version "0.2.13"
resolved "https://registry.yarnpkg.com/angular-ui-router/-/angular-ui-router-0.2.13.tgz#ab40c2f9fef9b8626ffdb29a793426c1fedd2f29"
angular@1.5.8:
angular@1.5.8, angular@>=1.0.6:
version "1.5.8"
resolved "https://registry.yarnpkg.com/angular/-/angular-1.5.8.tgz#925a5392b8c212d09572dc446db7e01264e094cb"
angular@>=1.0.6:
version "1.6.7"
resolved "https://registry.yarnpkg.com/angular/-/angular-1.6.7.tgz#0f89837dae1776b01ccb1fa2096db0d9373d9897"
angularjs-viewhead@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/angularjs-viewhead/-/angularjs-viewhead-0.0.1.tgz#31a3b0dd837eecf0bb5a7da22b6561431251c6df"