Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Oct 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DragAndDrop - onDrop: Change position

    Somebody can tell me what do i have to add at the 'onDrop : function' in the below script to drop the button at the cursor position after the user released the button ?

    Code:
    var windowObserver =
    {
    	onDragStart : function (element, transferData)
    	{
    		var Button = document.getElementById('Button');
    
    			transferData.data = new TransferData();
    	    		transferData.data.addDataForFlavour('Button-ID', Button);
    	},
    
    	getSupportedFlavours : function ()
    	{
    		var flavours = new FlavourSet();
    			flavours.appendFlavour('Button-ID');
    				return flavours;
    	},
    
    	onDrop : function (){},
    };

  • #2
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    would it not be onmouseup?
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #3
    New Coder
    Join Date
    Oct 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by canadianjameson
    would it not be onmouseup?
    Should i have to clarify that this is more an xul related question, if 'Yes', i excuse this mistake

    If i try to set the x/y via setAttribute at 'onDrop' i get an 'NS_ERROR_FAILURE' ala 'What to drop, no data' !?!

  • #4
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by DefKev
    Should i have to clarify that this is more an xul related question, ....
    It would stand to reason that it would be in your best interest to clarify whatever is necassary to aide whomever is willing to help you...

  • #5
    New Coder
    Join Date
    Oct 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Willy Duitt
    It would stand to reason that it would be in your best interest to clarify whatever is necassary to aide whomever is willing to help you...
    The situation was what i had a simple window/stack/whatever with an 'onDragGesture', 'onDrop' ...

    inside this was a button which calls the below *.js whenever the user starts dragging the button (drag and motion), the problem was that i had no idea what to call after the user has released the button somewhere inside this area to drop the button at the chosen position ('onDrop').

    I allready figured it out, so, hm ... thanks anyway

  • #6
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by DefKev
    Quote Originally Posted by Willy Duitt
    It would stand to reason that it would be in your best interest to clarify whatever is necassary to aide whomever is willing to help you...
    The situation was what i had a simple window/stack/whatever with an 'onDragGesture', 'onDrop' ...

    inside this was a button which calls the below *.js whenever the user starts dragging the button (drag and motion), the problem was that i had no idea what to call after the user has released the button somewhere inside this area to drop the button at the chosen position ('onDrop').

    I allready figured it out, so, hm ... thanks anyway
    No need to thank me, anyways or not....
    What you quoted was the extent of what I was willing to contribute... I only thought I should point out that sarcasm does not inspire nor promote effective feed back.... Just remember, it is you seeking a solution... Not someone else seeking a problem to solve....

    .....Willy

  • #7
    New Coder
    Join Date
    Oct 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Willy Duitt
    No need to thank me, anyways or not....
    What you quoted was the extent of what I was willing to contribute... I only thought I should point out that sarcasm does not inspire nor promote effective feed back.... Just remember, it is you seeking a solution... Not someone else seeking a problem to solve....

    .....Willy
    I can't see any sarcasm in my question, so why do you start b!tching me ?

    I have asked a DOM related question, and i expected a answer on my question not someone replying to it like 'im a retard' (this is not the reason why i visit a forum) !

    If you don't want or can answer a question in a constructionally way, stop wasting other peoples time, it's not my debt if you misunderstand thinks.

    'Thanks anyway' : a politeness phrase for taking your time and replying to my question, nothing more - nothing less.

  • #8
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Where I'm sitting...

    hm... thanks anyway is no more polite than Should i have to clarify that this is more an xul related question, if 'Yes', i excuse this mistake...

    Both come off as sarcastic... And if you can not see that my posts were politely trying to show that your posts came off as sarcastic... Perhaps its you whom are wasting your own time... Without comprehension, you will only continue to flounder and repeat the same mistakes of the past...

    Have a nice day;
    .....Willy

  • #9
    New Coder
    Join Date
    Oct 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Have a nice day too.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •