Thank you moro, mousedown was the event I was looking for! Works great even with IE now ![]()
1 2008-09-24 20:37:40
Re: catch scroll event (4 replies, posted in Help)
2 2008-09-24 19:26:11
Re: catch scroll event (4 replies, posted in Help)
Thank you for replying so quickly ![]()
That works if the user actually scrolls but not if he only clicks on the scroll bar (since no actual scroll event are sent).
Is there a way to catch a click on that scroll bar ? I've tried this:
new Mif.Tree({
initialize: function(){
this.wrapper.addEvent('click', function(){
alert('click');
});
},
...
});But only clicks on the div of the wrapper are caught, not on the scroll bar ![]()
3 2008-09-24 18:39:03
Topic: catch scroll event (4 replies, posted in Help)
Hi Moro,
How can I catch the onscroll event ?
My real problem is the following:
I have an input that, when the user sets focus on it, I open a pop-up with a Mif.Tree in it.
The user can then select an item in the tree and it will fill in the input with the corresponding item path. The thing is, on the blur event of the input, I hide this pop-up. In order to prevent the Mif.Tree pop-up from disappearing when the user clicks on an item, I set a timer on the blur of the input as follows:
--------8<---------------------------
/*...*/
'focus': function(){
$clear(blur_timer);
dirSelector.setInput(this);
dirSelector.show();
}
'blur': function(){
blur_timer = function() {
dirSelector.hide();
}.delay(200, this);
}
/*...*/
--------8<---------------------------
And my class that derives from Mif.Tree, I do the following:
--------8<---------------------------
var DirectorySelector = new Class({
Extends: Mif.Tree,
/*...*/
setInput: function(input){
this.options.input = $(input);
},
show: function(){
this.options.container.setStyle('height', '0');
this.updatePosition();
new Fx.Tween(this.options.container).start('height', 0, 200);
},
hide: function(){
this.options.container.setStyles({'top': '-1000px', 'height': '0'});
},
toggleClick: function(event){
// Force focus to input
this.options.input.blur();
(function() {this.options.input.focus();}).delay(1, this);
this.parent(event);
}
});
--------8<---------------------------
As you can see, clicking an item of the tree sets the focus back to the input. This works fine with all browsers except with IE when I try to scroll, the input loses focus and so the pop-up disappears.
This is why I ask: who can I catch the onscroll event in order to force focus back to the input ?
Thank you for your time.
Cheers,
Peter
4 2008-07-24 16:20:58
Topic: Leave focus alone (1 replies, posted in Help)
Hi Moro,
I have an input field in which I have to enter a path.
When I select this field, I display a Mif.Tree underneath it in order to easily select this path (the tree represents a directory structure).
With Safari 3, when you select an element in the tree, the focus remains on the input field. This is what I want.
With Firefox 3, when you select an element in the tree, the input field looses focus to the current node. In order to act the same way as Safari, I commented out lines 496, 497 and 498 of mif.tree-v1.0.js :
//if(Browser.Engine.gecko) {
// this.wrapper.focus();
//}With IE 7, I always loose focus: The current selected node takes it.
Is there a way to prevent this?
Thanks,
Peter
5 2008-07-24 11:22:46
Re: delete tree (3 replies, posted in Help)
Thank you moro, that works great ![]()
PS: Sorry for the late feedback...
6 2008-07-01 19:44:21
Re: Only certain nodes have a checkbox and not others (4 replies, posted in Feature requests)
Excellent!!
any chance of getting rid of the gap where there aren't any checkboxes?
7 2008-07-01 19:06:56
Topic: delete tree (3 replies, posted in Help)
Hi Moro,
How do you delete the content of a tree? (or subtree)
I have a Mif.Tree object which I populated using load(json...). But I would like to clear it to re-populate it with new data. If I call load twice, the new data is appended to the previous one.
Cheers,
Peter
8 2008-06-27 21:07:39
Topic: Only certain nodes have a checkbox and not others (4 replies, posted in Feature requests)
Hello Moro,
Thank you for providing such a great Tree object.
I have a little feature request:
How about being able to set a check box only to certain nodes instead of all or nothing?
Cheers,
Peter