Drag'n'drop

25 views
Skip to first unread message

datar...@gmail.com

unread,
Jul 12, 2016, 11:00:59 AM7/12/16
to DalekJS
Hi, 
I would like to know how to make a drag'n'drop with the mouse with dalekjs.
Thanks.

datar...@gmail.com

unread,
Jul 13, 2016, 5:56:07 AM7/13/16
to DalekJS
Or if we can add https://github.com/j-ulrich/jquery-simulate-ext on dalek it will be great ?

datar...@gmail.com

unread,
Jul 13, 2016, 8:22:13 AM7/13/16
to DalekJS
or include this : https://github.com/Kuniwak/html-dnd HTML Drag and Drop Simulator


On Tuesday, 12 July 2016 16:00:59 UTC+1, datar...@gmail.com wrote:

datar...@gmail.com

unread,
Jul 14, 2016, 7:53:26 AM7/14/16
to DalekJS
I succeed  to make a drag n drop with the .execute(function () {) of dalek and load this javascript libraries  https://github.com/j-ulrich/jquery-simulate-ext :

.execute(function () {

function getScript(url, callback) {
           var head = document.getElementsByTagName('head')[0];
           var script = document.createElement('script');
           script.src = url;

           var done = false;
           // Attach handlers for all browsers
           script.onload = script.onreadystatechange = function() {
               if (!done && (!this.readyState ||
                       this.readyState == 'loaded' || this.readyState == 'complete')) {
                   done = true;
                   if (callback)
                       callback();

                   // Handle memory leak in IE
                   script.onload = script.onreadystatechange = null;
               }
           };

           head.appendChild(script);

           // We handle everything using the script element injection
           return undefined;
       }

function initdragndrop() {
$('somedivtodrag"]').simulate("drag-n-drop", {dx: 400});
}
$(function () {
               var scripts = [
                       location.search.substring(1) || 
                       'http://localhost:58000/eem/js/lib/jquery-simulate-ext-master/src/jquery.simulate.ext.js',                        
                       
                   ],
                   eachSeries = function (arr, iterator, callback) {
                       callback = callback || function () {};
                       if (!arr.length) {
                           return callback();
                       }
                       var completed = 0;
                       var iterate = function () {
                           iterator(arr[completed], function (err) {
                               if (err) {
                                   callback(err);
                                   callback = function () {};
                               }
                               else {
                                   completed += 1;
                                   if (completed >= arr.length) {
                                       callback(null);
                                   }
                                   else {
                                       iterate();
                                   }
                               }
                           });
                       };
                       iterate();
                   };
               eachSeries(scripts, getScript, initdragndrop);
           });

   })


On Tuesday, 12 July 2016 16:00:59 UTC+1, datar...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages