Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Added setContainer() method for Drag.Move #1137

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

lorenzos commented Jul 25, 2012

This allows us to set and change drag container also after Drag.Move constructor call, and multiple times.

@anutron anutron and 1 other commented on an outdated diff Jul 26, 2012

Source/Drag/Drag.Move.js
@@ -65,6 +62,15 @@ Drag.Move = new Class({
this.addEvent('start', this.checkDroppables, true);
this.overed = null;
},
+
+ setContainer: function(container) {
+
+ this.container = document.id(container);
+
+ if (this.container && typeOf(this.container) != 'element')
+ this.container = document.id(this.container.getDocument().body);
+
+ },
@anutron

anutron Jul 26, 2012

Owner
container = document.id(container);
this.container = container || document.id(this.container.getDocument().body);
@lorenzos

lorenzos Oct 22, 2012

Contributor

That is not exactly equal to the source code. Anyway, I will do as you suggest and re-pull request.

Member

SergioCrisostomo commented May 3, 2014

@lorenzos nice!

@anutron @arian @kentaromiura - thumbs up anyone?

Example of the new .setContainer() http://jsfiddle.net/Y6ALp/

Owner

anutron commented May 5, 2014

🚀

Owner

anutron commented May 5, 2014

Do we have test coverage for this class yet? If so, would be nice to add a test for it...

Owner

anutron commented May 5, 2014

not a blocker though. ship it.

Member

SergioCrisostomo commented May 6, 2014

@lorenzos thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment