Home How to add listener inside html5-sortable-angularjs event?
Reply: 0

How to add listener inside html5-sortable-angularjs event?

user1026
1#
user1026 Published in May 21, 2018, 5:05 pm

I am using this plugin https://github.com/bachvtuan/html5-sortable-angularjs/ and I need to add a listener inside an event.

The documentation only gives the following example.

//Options for sortable code
$scope.sortable_option = {
//Only allow draggable when click on handle element
handle:'p.handle',
//Construct method before sortable code
construct:function(model){
for ( var i = 0; i < model.length; i++ ){
  model[i].letter +=" (constructed)";
}
},
//Callback after item is dropped
stop:function(list, dropped_index){
list[ dropped_index].letter += " Dropped";
}
};

I need to add e.preventDefault(); to the handleDragEnter event. I need this because I implemented a fix for the drag feature on mobile and it needs this to work.

This works when added directly to the plugin but obviously I don't want to modify the plugin itself.

sortable.handleDragEnter = function(e) {
    e.preventDefault();
  };
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.330153 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO