Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Improved toggle #176

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b9b66e1
refactor(toggle): renamed local variable 'result' to 'isCollapsed' to…
widmoser Jan 7, 2016
a03f328
refactor(toggle): simplified code that modifies the toggle buttons af…
widmoser Jan 7, 2016
97030ec
refactor(toggle): removed unnecessary toggle code
widmoser Jan 7, 2016
6d1ca1c
feat(toggle): removed manual 'click' event when toggling programmatic…
widmoser Jan 7, 2016
07491d3
feat(toggle): removed the ui-layout-loaded indirection
widmoser Jan 7, 2016
2ccb399
test(toggle): fixed tests
widmoser Jan 7, 2016
710c2fa
test(toggle): removed tests related to ui-layout-loaded
widmoser Jan 7, 2016
ae4a70b
doc(toggle): removed documentation related to ui-layout-loaded
widmoser Jan 7, 2016
4724ebf
feat(toggle): removed references that are not needed
widmoser Jan 8, 2016
c2fc151
fix(toggle): central containers could not be collapsed
widmoser Jan 20, 2016
c95fe4d
Merge branch 'master' into feature/toggle
widmoser Feb 20, 2016
8864d83
feat(toggle): re-added ui-layout-loaded directive to simulate previou…
widmoser Feb 20, 2016
56a26b4
style: cleaned up diff
widmoser Feb 20, 2016
3c888d8
feat(toggle): Add option to hide a collapsed splitbar
widmoser Apr 13, 2016
55f725f
feat(toggle): Add option to control whether a container collapses to …
widmoser Apr 13, 2016
9d8430d
feat(toggle): Change collapseToMinSize to hideCollapsedContainer to k…
widmoser Apr 13, 2016
1e677cc
feat(toggle): Trigger ui.layout.resize event whenever a size changes …
widmoser Apr 13, 2016
34048ff
feat(toggle): Fix collapsed state of splitbar
widmoser May 26, 2016
68403bc
feat(toggle): Fix collapse state of splitbar (right container)
widmoser May 26, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ Default: `false`

Like `disableToggle` above but only removes the arrows on mobile devices (max-device-width: 480px).

### hideCollapsedSplitbar

Type: `Boolean`
Default: `false`

If set to `true`, the splitbar between two containers will not be visible when one of them is collapsed.

### hideCollapsedContainer

Type: `Boolean`
Default: `false`

Whether to completely hide a collapsed container, even if it has a minimum size set. If this option is set to `false` a collapsed container will have a size equal to the `min-size` property.

## Child Attributes

Expand Down Expand Up @@ -145,7 +158,7 @@ $scope.layout {
}
```

Changing those values will toggle container. See also [`ui.layout.toggle`][event-toggle].
Changing those values will toggle container. See also [`ui.layout.toggle`][event-toggle].

### size
Type: `String`
Expand Down Expand Up @@ -203,11 +216,12 @@ percentage

## Events

Events are broadcast on the scope where ui-layout is attached. This means they are available to any controller inside of a ui-layout container.
Events are broadcast on the scope where ui-layout is attached. This means they are available to any controller inside of a ui-layout container.

### ui.layout.loaded
Returns: `string` or `null`

**Deprecated:** *This event is not needed any more because programmatic toggle works now as expected. It is only kept for compatibility reasons. The event will be triggered immediately, when the directive links.*

Dispatched when the layout container finished loading. It returns the value of the attribute, e.g. `ui-layout-loaded="my-loaded-message"`, or `null`. The `null` also means that the layout has finished collapsing all the containers that should be collapsed (per application request when setting the [`collapsed`][collapsed] attribute).

Expand All @@ -226,7 +240,7 @@ All this means that the user will notice a flicker. If the flicker is not desira
<div ui-layout-container>
<div ui-layout ui-layout-loaded="child-container">
<div ui-layout-container>

</div>
</div>
</div>
Expand Down Expand Up @@ -271,8 +285,8 @@ $scope.$on('ui.layout.toggle', function(e, container){
});
```

Manually toggling (clicking the arrow button on the splitbar) will not update the `collapsed` attribute.
If the application is using the `collapsed` attribute of `ui-layout-container` to programmatically control the collapsed state, the application should update it's state when this event occurs to stay in sync with the UI.
Manually toggling (clicking the arrow button on the splitbar) will not update the `collapsed` attribute.
If the application is using the `collapsed` attribute of `ui-layout-container` to programmatically control the collapsed state, the application should update it's state when this event occurs to stay in sync with the UI.

### ui.layout.resize

Expand Down
Loading