ractivejs / ractive-decorators-sortable Goto Github PK
View Code? Open in Web Editor NEWDrag and drop items to sort them
Home Page: http://ractivejs.github.io/Ractive-decorators-sortable/
License: MIT License
Drag and drop items to sort them
Home Page: http://ractivejs.github.io/Ractive-decorators-sortable/
License: MIT License
See:
Apparently, keypath.lastIndexOf
was removed, causing the code to break with the edge version.
RactiveJS defines itself as ractive
not Ractive
.
After enabling sortable I am unable to modify the default value for input boxes
What happens is that the cursor gets focus at the beginning of the value for an input box. So if there is a value defined in the template, then I cannot edit it!
Example:
ul
{{#datalist}}
li class="itemwrap" decorator="sortable"
div class="content_item_entry"
div class="item_entry_grip"
i class="fa fa-bars text-muted" /i
/div
div class="item_details_container"
input class="item_entry_section" value="{{title}}"/
/li
{{/datalist}}
/ul
The input's default value cannot be edited.
Thanks,
@Rich-Harris I'm updating this for the latest ractive version. Can you give me publish rights for npm?
require should not register plugin
In:
removeTargetClass = function () {
this.classList.remove( sortable.targetClass );
};
The "this" is undefined. I guess it's a low priority bug though.
Uncaught TypeError: Cannot read property 'keypath' of undefined
// add source back to array in new location
array.splice( sourceIndex, 0, source );
If I try to use this on component:
<component decorator="sortable"></component>
'The "intro", "outro" and "decorator" directives have no effect on components.'
..or on component template:
<div class="component" decorator="sortable"></div>
'The sortable decorator only works with elements that correspond to array members'
I think a component user-case is pretty common..
Would it be an option to give the array as a parameter:
<div decorator="sortable:array"></div>
Hi,
I've been using Ractive to rebuild an old AngularJS application and I've been absolutely in love with it. Up until right about now. In the previous app I used jQuery UI's -sortable- together with an Angular plugin to create connected sortable lists with proper two-way binding. With Ractive however, I can't seem to get it to work. This Ractive sortable decorator doesn't seem to support connected lists (am I wrong?) and simply including jQuery UI to manipulate the DOM means the entire app goes haywire. I've even tried creating an 'on sortable stop' method to restore the DOM to its earlier state and then passing the new list variable to Ractive, but to no avail.
Can the decorator support connected lists, or will it in the near future? Or are there other ways to implement this functionality? I would really love to keep using Ractive, but as the functionality is critical for the app, I might have to switch frameworks again...
Thanks in advance for any help :)
The dragenterHandler checks whether targetArray and sourceArray are identical but sourceArray is not reset on drop. So after the sortable has been used the first time it will react to any dragenter.
I'll submit a pull request soon.
Error message
Uncaught TypeError: sourceKeypath.lastIndexOf is not a functiondragstartHandler @ Sortable.js:72
I'd like to use this plugin in a project managed by maven. For this purpose, I'd need to have this plugin embedded in a webjars, as RactiveJS is. See http://www.webjars.org/
Could you please tag a release for this plugin, so that a webjar could be generated as an artifact with this plugin?
The associated github thread is here: webjars/webjars#1049 (comment)
Thanks
Here I've created an updated repo: https://github.com/Skyrpex/ractive-decorators-sortable
It's like the other updated Ractive plugins (npm ready, babel).
It could be integrated into this one...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.