Skip to forum content

Mif

— mystic javascript interface

You are not logged in. Please login or register.


Post new reply

Post new reply

Compose and post your new reply

You may use: BBCode Images Smilies

All fields labelled (Required) must be completed before the form is submitted.

Required information for guests



Captcha image. Turn pictures on to see it.
Required information
Optional post settings

Topic review (newest first)

1

for drop to some input

new Mif.Tree.Drag(tree, {
    droppables: [
        new Mif.Tree.Drag.Element(input,{
            onDrop: function(node){
                input.value = node.name
            }
        })
    ]
});

for drop to any input

var dropable = new Mif.Tree.Drag.Element(document.body,{
    onDrop: function(node){
        if(this.where == 'inside'){
            this.target.value = node.name
        }
    }
});
dropable.ondrag = function(event){
    var target = $(event.target);
    if(target.get('tag') != 'input'){
        this.where = 'notAllowed';
    }else{
        this.where = 'inside';
    }
    this.target = target;
    Mif.Tree.Drag.ghost.firstChild.className='mif-tree-ghost-icon mif-tree-ghost-' + this.where;
}
new Mif.Tree.Drag(tree, {
    droppables: [
        dropable
    ]
});

2

Hello, I have a question.
I dont want to use the drag and drop function to move or to copy a catchword.
I want to make it possbile that user have the chance to drag a catchword from the tree and to drop it in any html text field.
By dropping a catchword into the text field the name of the catchword should appear in the text field.

Is it possible to do that??

Jonathan