From dadaec11b1767429b94ba000fb2eb034326179c0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 18 Jul 2012 02:52:13 -0400 Subject: Drag --- static/js/pichat.js | 18 +++++++++--------- static/js/pichat2.js | 18 +++++++++--------- static/js/src/drag.js | 18 +++++++++--------- 3 files changed, 27 insertions(+), 27 deletions(-) (limited to 'static') diff --git a/static/js/pichat.js b/static/js/pichat.js index 286edb9..1f1cf43 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -548,7 +548,7 @@ function dragTarget (target, callbacks) { base.enter = function(e){ base.target.classList.add('over'); if ('enter' in callbacks) { - callbacks.enter(Drag.imgSrc); + callbacks.enter(Drag.url); } return false; } @@ -557,21 +557,21 @@ function dragTarget (target, callbacks) { e.preventDefault(); // Necessary. Allows us to drop. } if ('over' in callbacks) { - callbacks.over(Drag.imgSrc); + callbacks.over(Drag.url); } return false; } base.leave = function(e){ base.target.classList.remove('over'); if ('leave' in callbacks) { - callbacks.leave(Drag.imgSrc); + callbacks.leave(Drag.url); } return false; } base.end = function(e){ base.target.classList.remove('over'); if ('leave' in callbacks) { - callbacks.leave(Drag.imgSrc); + callbacks.leave(Drag.url); } return false; } @@ -584,7 +584,7 @@ function dragTarget (target, callbacks) { e.preventDefault(); } if ('drop' in callbacks) { - callbacks.drop(Drag.imgSrc); + callbacks.drop(Drag.url); } return false; } @@ -592,16 +592,16 @@ function dragTarget (target, callbacks) { }; window.Drag = { - 'imgSrc': "", + 'url': "", 'bindImages': function (){ - $('.unbound').each(function(index,img){ - img.addEventListener('dragstart', Drag.start, false); + $('img.unbound').each(function(img){ + this.addEventListener('dragstart', Drag.start, false); $(this).removeClass('unbound'); }); }, 'start': function(e){ if (this.src) { - Drag.imgSrc = this.src; + Drag.url = this.src; } } } diff --git a/static/js/pichat2.js b/static/js/pichat2.js index 286edb9..1f1cf43 100644 --- a/static/js/pichat2.js +++ b/static/js/pichat2.js @@ -548,7 +548,7 @@ function dragTarget (target, callbacks) { base.enter = function(e){ base.target.classList.add('over'); if ('enter' in callbacks) { - callbacks.enter(Drag.imgSrc); + callbacks.enter(Drag.url); } return false; } @@ -557,21 +557,21 @@ function dragTarget (target, callbacks) { e.preventDefault(); // Necessary. Allows us to drop. } if ('over' in callbacks) { - callbacks.over(Drag.imgSrc); + callbacks.over(Drag.url); } return false; } base.leave = function(e){ base.target.classList.remove('over'); if ('leave' in callbacks) { - callbacks.leave(Drag.imgSrc); + callbacks.leave(Drag.url); } return false; } base.end = function(e){ base.target.classList.remove('over'); if ('leave' in callbacks) { - callbacks.leave(Drag.imgSrc); + callbacks.leave(Drag.url); } return false; } @@ -584,7 +584,7 @@ function dragTarget (target, callbacks) { e.preventDefault(); } if ('drop' in callbacks) { - callbacks.drop(Drag.imgSrc); + callbacks.drop(Drag.url); } return false; } @@ -592,16 +592,16 @@ function dragTarget (target, callbacks) { }; window.Drag = { - 'imgSrc': "", + 'url': "", 'bindImages': function (){ - $('.unbound').each(function(index,img){ - img.addEventListener('dragstart', Drag.start, false); + $('img.unbound').each(function(img){ + this.addEventListener('dragstart', Drag.start, false); $(this).removeClass('unbound'); }); }, 'start': function(e){ if (this.src) { - Drag.imgSrc = this.src; + Drag.url = this.src; } } } diff --git a/static/js/src/drag.js b/static/js/src/drag.js index f6738db..b48c365 100644 --- a/static/js/src/drag.js +++ b/static/js/src/drag.js @@ -16,7 +16,7 @@ function dragTarget (target, callbacks) { base.enter = function(e){ base.target.classList.add('over'); if ('enter' in callbacks) { - callbacks.enter(Drag.imgSrc); + callbacks.enter(Drag.url); } return false; } @@ -25,21 +25,21 @@ function dragTarget (target, callbacks) { e.preventDefault(); // Necessary. Allows us to drop. } if ('over' in callbacks) { - callbacks.over(Drag.imgSrc); + callbacks.over(Drag.url); } return false; } base.leave = function(e){ base.target.classList.remove('over'); if ('leave' in callbacks) { - callbacks.leave(Drag.imgSrc); + callbacks.leave(Drag.url); } return false; } base.end = function(e){ base.target.classList.remove('over'); if ('leave' in callbacks) { - callbacks.leave(Drag.imgSrc); + callbacks.leave(Drag.url); } return false; } @@ -52,7 +52,7 @@ function dragTarget (target, callbacks) { e.preventDefault(); } if ('drop' in callbacks) { - callbacks.drop(Drag.imgSrc); + callbacks.drop(Drag.url); } return false; } @@ -60,16 +60,16 @@ function dragTarget (target, callbacks) { }; window.Drag = { - 'imgSrc': "", + 'url': "", 'bindImages': function (){ - $('.unbound').each(function(index,img){ - img.addEventListener('dragstart', Drag.start, false); + $('img.unbound').each(function(img){ + this.addEventListener('dragstart', Drag.start, false); $(this).removeClass('unbound'); }); }, 'start': function(e){ if (this.src) { - Drag.imgSrc = this.src; + Drag.url = this.src; } } } -- cgit v1.2.3-70-g09d2