Comments (5)
Hi all,
I've a similar question: If I set the size attribute as an scope variable based value, the initial size is rendered well. (e.g. The width of the ui-layout-container is correct.)
-
Now I move the divider and $watch size or inspect it in Firebug: the value of size never changes. (..but the witdh of course).
-
If I use the function setSize(), value of size changes, but the divider does not move.
How can I steer the divider position with changing value for size?
http://plnkr.co/edit/aqqRIX?p=info
Thx to all and have a nice weekend
from ui-layout.
Since ui-layout inherets the current scope all you need to do is call $scope.updateDisplay()
in your controller.
Change your setSize function to the following and it works.
$scope.setSize = function (){
$scope.sizeA ++;
$scope.sizeB --;
console.info($scope.sizeA + " " + $scope.sizeB)
$timeout(function(){
$scope.updateDisplay();
});
};
from ui-layout.
Hmmm… I just tried that exactly, but it doesn’t resize consistently. I’ve got a $scope.$on(…) waiting on an event, see below.
If seems it needs to be called a few times to actually trigger the resize.
$scope.$on('selectionChanged', function (event, selection) {
if (selection) {
$scope.viewerWidth = '750px';
$scope.updateDisplay();
}
});
Any clue?
Eric
On Dec 2, 2014, at 6:55 PM, Jonathan Broquist [email protected] wrote:
Since ui-layout inherets the current scope all you need to do is call $scope.updateDisplay() in your controller.
Change your setSize function to the following and it works.
$scope.setSize = function (){
$scope.sizeA += 10;
$scope.sizeB -= 10;
console.info($scope.sizeA + " " + $scope.sizeB)
$scope.updateDisplay();
}
—
Reply to this email directly or view it on GitHub #58 (comment).
from ui-layout.
Wrap it in a $timeout
function and that will solve your problem.
On Dec 2, 2014, at 10:56 PM, Eric Dillon [email protected] wrote:
Hmmm… I just tried that exactly, but it doesn’t resize consistently. I’ve got a $scope.$on(…) waiting on an event, see below.
If seems it needs to be called a few times to actually trigger the resize.$scope.$on('selectionChanged', function (event, selection) {
if (selection) {
$scope.viewerWidth = '750px';
$scope.updateDisplay();
}
});Any clue?
EricOn Dec 2, 2014, at 6:55 PM, Jonathan Broquist [email protected] wrote:
Since ui-layout inherets the current scope all you need to do is call $scope.updateDisplay() in your controller.
Change your setSize function to the following and it works.
$scope.setSize = function (){
$scope.sizeA += 10;
$scope.sizeB -= 10;
console.info($scope.sizeA + " " + $scope.sizeB)
$scope.updateDisplay();
}
—
Reply to this email directly or view it on GitHub #58 (comment).—
Reply to this email directly or view it on GitHub.
from ui-layout.
Hello all,
thx for answering. It seems with $scope.updateDisplay() I can achieve target 2).
http://plnkr.co/edit/aqqRIX?p=preview
But I've no clue to "bring back " a change of divider position to my $scope.size. I could select the divider and watch them left attribute and recalculate size of the boxes but I guess there is a better way.
from ui-layout.
Related Issues (20)
- snap to edge support at reaching certain container size
- resizable parameter
- detecting pane size in pixel after resize HOT 1
- resize panel to contents
- Unable to stop splitter event
- disable animations HOT 1
- Odd problem trying to start ui-layout HOT 2
- Layout not rezized when parent size change HOT 2
- Ui-layout overlaps every other page element. Is not Bootstrap friendly HOT 1
- Horizontal movement of splitbar is not resizing contents HOT 1
- Main window resize
- How to disableToggle for individual splitbar? HOT 2
- splitbar can't stop moving by mousemove
- Add Version Number to source JS file
- Percent sized containers and toggle buttons with some browsers are broken HOT 1
- Percent min-size and max-size should be recalculated on resize
- CHANGELOG.md not up to date HOT 2
- Hiding and then showing the layout doesn't re-calculate offsets properly. HOT 2
- Toggle functionality not working properly
- Resizing doesn't work properly with an iframe
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ui-layout.