Giter VIP home page Giter VIP logo

Comments (8)

mechanicious avatar mechanicious commented on September 8, 2024

I've recognized this issue. Dragging definitely needs fine-tuning. I'll make sure to incude patch for it in the next release, however, please provide me enough information to reproduce the problem as there can be many possible causes to this unwanted behaviour.

from domenu.

s0By avatar s0By commented on September 8, 2024

Noted. Will try to specify more details in the future.
Is there a way to block a particular dd-item from having a "working" content (title) edit?
When domenu kicks in I launch a function that spreads classes based on the domenu json, my json is custom
data: '[{"title":"Account","type":"service"},{"title":"Settings","type":"category"}]'
I was wondering if It's possible to set these custom attributes to json when I create an item?

from domenu.

mechanicious avatar mechanicious commented on September 8, 2024

Utilize onCreateItem event and the jQuery data method.

...domenu().onCreateItem(function($item) {
  $item.data($.extend(true, $item.data(), {customAttr: "custom value"}));
});

doMenu uses $item.data() of each item to serialize it to JSON.

from domenu.

s0By avatar s0By commented on September 8, 2024

It would be a nice enhancement if you'd be able to visually see when you're not allowed to drag under an element (when maxdepth is reached), like here for example.

Are there going to be "shortcut" functions in the future? Like getParent() of an element etc.?

Currently trying to achieve a block for element, similar to maxdepth behavior, but not sure if it's possible yet in this solution.

I need to to utilize onItemDrag so when I try to put an element under some other (the other element is parent) and if that element has my "special" attribute, then I can't put it there. Had no success achieving that, does the script understand which item is parent while in onItemDrag state or does it understand that only in onItemDrop state?

from domenu.

mechanicious avatar mechanicious commented on September 8, 2024

There will be an separate API for items included in the next release which will feature methods alike.

Try to establish the parent using the corresponding placeholder as specified by the placeClass option.

from domenu.

s0By avatar s0By commented on September 8, 2024

placeClass can do the job, but in order to utilize it I need an event, something like onItemMove which would kick in from dragMove, so it would track everything that's happening with the item that is dragged. Well, necessity of utilizing placeClass disappears because in this case it would be simpler to do something like getParent() because script is setting the parent in dragMove.

It would be great to have some output varieties for the flexibility of the plugin, like toArray, toHierarchy etc (idea from nestedSortable, looks handy).

I though nestable dragging was done well enough, why did you decide to tune it? Any approx. date when new release is coming?

from domenu.

mechanicious avatar mechanicious commented on September 8, 2024

@s0By Check out 0.99.77-rc1 it improves dragging and introduces the placeholder max-depth state.

from domenu.

coolboy4598 avatar coolboy4598 commented on September 8, 2024

@s0By can you please tell me how to do this?

I don't want to allow parent be child of another parent. But yes it should be allowed to drag as need to allow sorting.

from domenu.

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.