
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
oribella-aurelia-sortable
Advanced tools
Sortable plugin for Aurelia powered by Oribella
Install via JSPM
jspm install npm:oribella-aurelia-sortable
or NPM
npm install oribella-aurelia-sortable
Load the plugin
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin("oribella-aurelia-sortable");
aurelia.start().then(a => a.setRoot());
}
sortable, sortable-item will be available as global custom attributes.
To get started you need to bind the sortable, sortable-item attributes in conjunction with the repeat attribute.
<div sortable="items.bind: images">
<div repeat.for="image of images" sortable-item="item.bind image"></div>
</div>
This will enable the plugin to keep track of and move around the items.
However you might want to add a class to the element
that is currently moved around. Add a binding:
<!-- Other bindings omitted -->
<div sortable="sorting-class.bind: 'some-fancy-placeholder'">
</div>
sortingClass='oa-sorting'
It could then be used in the sortable-item
like this:
<!-- Other bindings omitted -->
<div sortable-item="item.bind: image" class="${image.sortingClass}">
</div>
If you have variable dimensions on the sortable-item
you can add a binding so the placeholder
gets the same size as the dragging element by:
<!-- Other bindings omitted -->
<div sortable-item="css.bind: item.style;">
</div>
If the sortable
custom attribute is in an area that is scrollable you have to bind either a selector
or an Element
or document
:
<!-- Other bindings omitted -->
<div sortable="scroll.bind: '.page-host'">
</div>
scroll=sortable
so it can auto scroll when needed. If you want you may even do a manual scroll when it's auto scrolling or combine them by first auto scrolling then manual scrolling and it should still behave as intended. If you are not happy with the sensitivity or scroll speed for the auto scroll you can set it with below bindings:
<!-- Other bindings omitted -->
<div sortable="scroll-sensitivity.bind: 20; scroll-speed.bind: 20">
</div>
scrollSpeed=10
- how many pixels it will scroll for each framescrollSensitivity=10
- how many pixels from the scroll
bounding threshold until it starts auto scrolling.If you have a vertical or horizontal list you can lock the sortable axis movement with:
<!-- Other bindings omitted -->
<!-- Lock to horizontal movement -->
<div sortable="axis: 'x'">
</div>
<!-- Lock to vertical movement -->
<div sortable="axis: 'y'">
</div>
axis=''
- sets the allowed axis movement.To make sure that the dragging of a sortable item always is on top of other elements make sure to bind:
<!-- Other bindings omitted -->
<div sortable="drag-z-index.bind: 120">
</div>
dragZIndex=1
- z-index of the dragging sortable item.To be able to have a sortable where you might be editing the sortable items you can control this by:
<!-- Other bindings omitted -->
<div sortable="disallowed-drag-tag-names.bind: 'DIV'">
</div>
disallowedDragTagNames=['INPUT', 'SELECT', 'TEXTAREA']
- element tags that disallows start dragging.If that is insufficient:
<!-- Other bindings omitted -->
<div sortable="allow-drag.call: allowDrag($event);">
</div>
allowDrag
@bindable allowDrag = args => {
if(this.disallowedDragTagNames.indexOf(args.event.target.tagName) !== -1) {
return false;
}
if(args.event.target.isContentEditable) {
return false;
}
return true;
};
where $event
has event
and item
properties.
event
- the native DOM event
item
- the sortable-item
view-model
Control whether a sortable item is allowed to move:
<!-- Other bindings omitted -->
<div sortable="allow-move.call: allowMove($event);">
</div>
allowMove
@bindable allowMove = () => { return true; };
where $event
has an item
property.
item
- the sortable-item
view-model
If you need it you can also bind moved
which will be called after an item has been sorted
<!-- Other bindings omitted -->
<div sortable="moved.call: moved($event);">
</div>
where $event
has fromIx
and toIx
properties.
fromIx
- the from index in the sortable
toIx
- the to index in the sortable
FAQs
Aurelia Sortable plugin powered by Oribella
The npm package oribella-aurelia-sortable receives a total of 61 weekly downloads. As such, oribella-aurelia-sortable popularity was classified as not popular.
We found that oribella-aurelia-sortable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.