-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(uiView): Do NOT autoscroll when autoscroll attr is missing
Breaking Change: If you had ui-views that you wanted to autoscroll to on state change, you may now need to explicitly add `autoscroll="true"`. Fixes #807
- Loading branch information
1 parent
4d74d98
commit a25c89d
Showing
2 changed files
with
3 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,10 +100,6 @@ | |
* Examples for `autoscroll`: | ||
* | ||
* <pre> | ||
* <!-- If autoscroll unspecified, then scroll ui-view into view | ||
* (Note: this default behavior is under review and may be reversed) --> | ||
* <ui-view/> | ||
* | ||
* <!-- If autoscroll present with no expression, | ||
* then scroll ui-view into view --> | ||
* <ui-view autoscroll/> | ||
|
@@ -214,7 +210,7 @@ function $ViewDirective( $state, $injector, $uiViewScroll) { | |
|
||
var clone = $transclude(newScope, function(clone) { | ||
renderer.enter(clone, $element, function onUiViewEnter() { | ||
if (!angular.isDefined(autoScrollExp) || !autoScrollExp || scope.$eval(autoScrollExp)) { | ||
if (angular.isDefined(autoScrollExp) && !autoScrollExp || newScope.$eval(autoScrollExp)) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
meenie
Contributor
|
||
$uiViewScroll(clone); | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@meenie is
newScope
the right scope var to use here?