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

Thanks, I have redo my code, and now it's ok.
i don't know why with all javascript in "source" folder .... I have the error, with only one "js" no problem.

2

Duduche1 wrote:

Hello, I have a problem with the integration
...
My problem is when I do a rigth-click nearby the label/name of the tree, the menu is visible, if I click on the label/name, nothing to do

The code is ok with a old version of tree+menu, but with the last version, I have this problem.

works for me http://mifjs.net/misc/tree_menu/

3

Hello, I have a problem with the integration

I have this definition of a menu :

    var testMenu = new Mif.Menu().load([
            {
                name: 'open',
                action: function()
                {
                    var current = this.treeItem;
                    if(!current) return;

                    alert('open : ' + current.id);
                }
            },
            {
                name: 'remove',
                disabled: true
            },
            {
                name: 'exit',
                id: 'exit'
            }
        ]);

With this event on the tree (otree) :

    otree.container.addEvent("contextmenu", function(event)
        {
            var node = otree.mouse.node;
            if(!node) return;

            testMenu.treeItem = node;
            testMenu.show(event);

            return false;
        });

My problem is when I do a rigth-click nearby the label/name of the tree, the menu is visible, if I click on the label/name, nothing to do

The code is ok with a old version of tree+menu, but with the last version, I have this problem.

4

Mif.Menu 1.2 and Mif.Tree 1.2.6 demo

5

To add/delete nodes with Mif.Menu only do the following:

  var testMenu=new Mif.Menu({
    list: {
      items: [
      {
        name: 'Add node here',
        onAction: function() {
          var current = this.menu.treeItem;
              if(!current) return;
              tree.add({
                property: {
              name: "testnode"
            }
          }, current, 'inside');
        }
      },
      {
        name: 'Drop this node',
        onAction: function() {
          var current = this.menu.treeItem;
          if (!current) return;
          current.remove();
        }
      }
    ]
  }
});
            
  tree.container.addEvent('contextmenu', function(event){
    var node=tree.mouse.node;
    if(!node) return;
    testMenu.show(event);
    testMenu.treeItem=tree.mouse.node;
    return false;
  });

6

Mif.Menu under development. If you use old(because new not exist yet) menu version all old code will work, because nothing changed :-)

7

Hi moro,
I've read that Mif.Menu is going to be rewritten, is that already done ? Or is the way of integrating MifTree and MifMenu you provided in 2008 still valid ?
Thanks in advance,
Jan

8

this demo 1.2.0

9

good

10

It works ... nice !
Thank you

11

i'm install ff3.0.4 pc, works for me.

alt+left click - temporal fix for opera, because it's don't support contextmenu event

i don't know how contextmenu event should work on mac os

12

On you must do   CTRL + Left click  to fire contextmenu event ...
I've just discovered it !...

On windows it works with right button

Do this demo use mootools 1.2.1 ?

13

I'm running Apple Mac OS X 10.5.5  with latest Firefox ...
I can't open context menu ... neither right or left click  doens't works ...

14

all components? u include Mif.Container?
u download this demo archive, it's work?

15

I'm running Mootools 1.2.1 
I've download Mif.Menu from your builder