Git Product home page Git Product logo

Comments (8)

isteven avatar isteven commented on August 22, 2024

Hi @apedrolli ,

Need to have a look first.. Can you paste your code (with those long labels) into plunker or jsfiddle?

from angular-multi-select.

apedrolli avatar apedrolli commented on August 22, 2024

Here you are!
http://embed.plnkr.co/s0ehmpGx2NVTq7PZrAWN/preview

thanks.

p.s. the problem is not on the label of the button, but on the label of the items in the item list

from angular-multi-select.

isteven avatar isteven commented on August 22, 2024

Hi @apedrolli ,

This is the consequence of using position: absolute on the checkboxLayer. There's nothing I can do about this.

If it's really important to you, either you change your page layout, or you can do this:

  1. Get the screen (or maybe viewport?) width
  2. Get the x pos of the checkboxLayer
  3. Get the width of the checkboxLayer
  4. If ( checkboxLayer x pos + checkboxLayer width ) > screen width then add that right: 0px;

Painful, I know :)

from angular-multi-select.

apedrolli avatar apedrolli commented on August 22, 2024

I'll try it! Little help on where this must be done? I think inside angular-multi-select.js, but where?
This info will fast me a lot.
Thanks.

from angular-multi-select.

isteven avatar isteven commented on August 22, 2024

I think you can do this using the on-open callback instead, so you can define the function in your controller.

One possible problem; I'm not sure how are you going to grab that particular checkboxLayer, especially if you are using more than one directive in a page. Maybe you really need to wrap that directive in a div, give an ID to that div, and then you grab it using the div's #ID .checkboxLayer selector.

from angular-multi-select.

apedrolli avatar apedrolli commented on August 22, 2024

You're right! I was forgetting that there are those callbacks!
I'll definitely try.
Thanks again!

from angular-multi-select.

apedrolli avatar apedrolli commented on August 22, 2024

if it could be usefull for someone, here is my code:

$scope.calcolaPosizione = function ($event) {

        var s = event.target.nextElementSibling;
    if (s.getBoundingClientRect) {        // Internet Explorer, Firefox 3+, Google Chrome, Opera 9.5+, Safari 4+
        var rect = s.getBoundingClientRect ();
        x = rect.left;
        //y = rect.top;
        w = rect.right - rect.left;
        //h = rect.bottom - rect.top;
        console.log(" Left: " + x + "\n Width: " + w);
    }
    else {
        console.log("Your browser does not support this example!");
    }
    var win = $window.innerWidth ;
    if (x + w > win) {
        console.log("need to set right:0");
        event.target.nextElementSibling.style.right = "0px";
    }
}

called by on-open="calcolaPosizione()"

thanks for the hints.

from angular-multi-select.

isteven avatar isteven commented on August 22, 2024

Hi @apedrolli ,

Thanks, great job on the code. Now I know what to suggest when others have similar problem.

I'll be closing this issue then. Cheers.

from angular-multi-select.

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.