Topic: disable Tree.KeyNav when initialize Menu.KeyNav
Hi there, I'm wondering if this is possible, if so could you provide a sample?
You are not logged in. Please login or register.
Pages 1
Hi there, I'm wondering if this is possible, if so could you provide a sample?
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.
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
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');
},
...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?
possible:-)
interesting to see final result
Posts [ 6 ]
Pages 1
Powered by PunBB