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

possible:-)

interesting to see final result

2

Thanks for your response and kudos on both your projects here.  I'd like to incorporate them into an app I'm working on.  I'm attempting to build an AJAX (without iframe) WYSIWYG.   I'd like to use the Mif.tree to control other HTML elements, that is, add+move+nest elements in this manner.  Also I'd like to use the Mif.menu to style the elements.  And finally, the elements themselves would be resizable via drag.   Does this sound possible?

3

sorry, but it's not possible right now. Blur, focus and keynav for focused widget only not yeat implemented.

You can hack tree and get focus/blur functionality. You can use this code as prototype:

Mif.Tree = new Class({

    Implements: [new Events, new Options],
        
    ...
    
    initEvents: function(){
        ...
        this.container.addEvent('click', this.focus.bind(this));
        document.addEvent('click', this.blurOnClick.bind(this));
        ...
    },
    
    blurOnClick: function(event){
        var target=event.target;
        while(target){
            if(target==this.container) return;
            target=target.parentNode;
        }
        this.blur();
    },
    
    focus: function(){
        if(this.focused) return;
        this.focused=true;
        this.container.addClass('mif-tree-focused');
        this.fireEvent('focus');
    },
    
    blur: function(){
        if(!this.focused) return;
        this.focused=false;
        this.container.removeClass('mif-tree-focused');
        this.fireEvent('blur');
    },
...

4

Ah, figured out what was wrong with the context menu loading anywhere on the page...

target: $('tree_container'),


... my bad there. Still trying to de-select (blur) selected node on .menu though

5

Related issue, how would I blur selected node when I focus on any other element on the page?  As is, the selected node's context menu is displayed regardless of where I rightclick on the page.

So essentially I'm asking if it's possible to restrict the context menu to the tree items as well as disable tree.keynav when initializing menu.keynav.

6

Hi there, I'm wondering if this is possible, if so could you provide a sample?