-
Notifications
You must be signed in to change notification settings - Fork 194
Persistent State #164
base: master
Are you sure you want to change the base?
Persistent State #164
Conversation
…r_components This helps in case the repository is cloned inside a larger project that has a different bower setup (e.g. for angular when the bower_components is inside the app folder)
… at the beginning
…ons are stored in local storage
This is achieved by adding an optional attribute layout-id in the markup to uniquely identify a ui-layout. The children are identified by their indices which are now correctly updated whenever they change.
Note that I intentionally omitted saving the collapsed state, because I need to read the code in more detail to understand it fully. Maybe the collapsing implementation can be simplified, before extending this feature to include it. |
I'm very interested in this, but there's so much formatting changes... you think you could clean that up a bit and push only the implementation details? Cheers ;) |
additionally, you've added a |
Ok I will try to clean everything up. |
I cleaned up the diff. I would really appreciate though, if we could agree on a consistent formatting style (space before |
Did you have a chance to check it @SomeKittens, @petrsimon? Should we merge it? |
I'm really sorry guys, I've been completely swamped lately. I will start working on ui-layout again in a month or so. But I will try to find time and look at this sooner unless it's dealt with even sooner :) |
@@ -83,7 +86,7 @@ angular.module('ui.layout', []) | |||
if(!beforeContainer.collapsed && !afterContainer.collapsed) { | |||
// calculate container positons | |||
var difference = ctrl.movingSplitbar[position] - lastPos; | |||
var newPosition = ctrl.movingSplitbar[position] - difference; | |||
var newPosition = ctrl.movingSplitbar[position] - difference; // TODO: this computation is unnecessary, newPosition === lastPos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open an issue for this instead of // TODO
Did another review pass, had a few questions. |
Thanks for the review @SomeKittens. Sorry for the delay, I've just seen the comments. I will have a look at it as soon as I have some time. |
Let me know when this has been cleaned up |
@SomeKittens: I have included your suggestions |
This pull requests adds the functionality of storing current container sizes in the local storage.
Fixes #13.
I've added some tests. I can add more if needed. Also I can update the README to reflect the changes if desired.
The basic idea is to assign a unique reconstructable id to every layout container and save the size as
uncollapsedSize
whenever a split bar is moved.