Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Overflow #58

Open
calebelt opened this issue Mar 10, 2016 · 5 comments
Open

Overflow #58

calebelt opened this issue Mar 10, 2016 · 5 comments

Comments

@calebelt
Copy link

Probably better to use offset() instead of element. Just need to add in the option in which item you want to place the clone. In this case, you will not have problems with overflow.

    var el = this.el, helper
    if (this.opts.clone) {
      if (typeof this.opts.clone === 'function') {
        helper = this.opts.clone.call(this.el)
      } else {
        helper = this.el.clone()
        if (this.opts.cloneClass) {
          helper.addClass(this.opts.cloneClass)
        }
      }
      var position = this.el.position()
      helper.css('position', 'absolute')
            .css('left', this.el.offset().left).css('top', this.el.offset().top) **<--- offset()**
            .width(this.el.width()).height(this.el.height())
//Clone
      helper.insertAfter('body') **<--- Element for clone**
@rkusa
Copy link
Owner

rkusa commented Mar 15, 2016

I think this could lead to issues with CSS not being applied anymore. E.g. when having <ul><li></li></ul> and something like ul > li { background-color: blue; }. Adding the <li> not only leads to invalid HTML, but more importantly the background-color is not applied anymore. What do you think?

@calebelt
Copy link
Author

Please look at the source code of this page here http://webismy.work/cms/dnd.html.
Inside the that can be moved to any part of the pages. Therefore, the clone should be on top of other elements.
And this is only the beginning. I'm planning to do the edit slider, gallery, menu, links, forms using dnd. Therefore, this function to clone just the necessary.

@rkusa
Copy link
Owner

rkusa commented Mar 17, 2016

Setting up z-index properly should also work in most scenarios. Maybe in yours, too?

@calebelt
Copy link
Author

What is inside the overflow: hidden will be hidden.
I can add to library functionality, but don't want to break up with your version.

@rkusa
Copy link
Owner

rkusa commented Mar 24, 2016

Ok, I misunderstood your issue. I am fine with adding it as long as it is disabled by default (to not break existing code).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants