From e93f1968a12f035eed88dcd81d54d50040b062d4 Mon Sep 17 00:00:00 2001 From: luxigo Date: Wed, 2 Mar 2016 22:49:53 +0700 Subject: [PATCH 1/2] Update ui-layout.js @danielpquinn Fix issue #143 occuring when switching to another view and index==0 here. --- src/ui-layout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui-layout.js b/src/ui-layout.js index 223b591..5ac2a51 100644 --- a/src/ui-layout.js +++ b/src/ui-layout.js @@ -387,7 +387,7 @@ angular.module('ui.layout', []) } } else { // fix for potentially collapsed containers - ctrl.containers[index - 1].collapsed = false; + if (index) ctrl.containers[index - 1].collapsed = false; numOfSplitbars--; } From baa45277d291d2a71f50becf0641d88b1277c8bf Mon Sep 17 00:00:00 2001 From: Luc Deschenaux Date: Sun, 27 Mar 2016 21:57:47 +0200 Subject: [PATCH 2/2] Enable publishing ui-layout controller into related scope (like ng-form) --- src/ui-layout.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ui-layout.js b/src/ui-layout.js index 5ac2a51..9bc8243 100644 --- a/src/ui-layout.js +++ b/src/ui-layout.js @@ -9,6 +9,10 @@ angular.module('ui.layout', []) var ctrl = this; var opts = angular.extend({}, $scope.$eval($attrs.uiLayout), $scope.$eval($attrs.options)); + if (opts.ctrl) { + $scope[opts.ctrl]=ctrl; + } + var numOfSplitbars = 0; //var cache = {}; var animationFrameRequested;