Coder Social home page Coder Social logo

Comments (5)

wwn avatar wwn commented on September 18, 2024

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.)

  1. Now I move the divider and $watch size or inspect it in Firebug: the value of size never changes. (..but the witdh of course).

  2. 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.

jbro-io avatar jbro-io commented on September 18, 2024

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.

erdillon avatar erdillon commented on September 18, 2024

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.

jbro-io avatar jbro-io commented on September 18, 2024

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?
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).


Reply to this email directly or view it on GitHub.

from ui-layout.

wwn avatar wwn commented on September 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.