Firebug lite domplate issue

62 views
Skip to first unread message

madura pradeep

unread,
Oct 3, 2012, 3:04:03 AM10/3/12
to fir...@googlegroups.com
I have develop a new panel for firebug lite and also define domplate inside it.I have some list boxes inside that domplate and i call a function when change the value of that. But it is not possible get value of the  list box using "event.target".My function shown as below.(my list box work fine and it is also called the function when change the value of it)

//listbox for select equal or like
    listbox:
        SELECT({onchange:"$listSelect"},
            OPTION({VALUE:"equal"},"equal"),
            OPTION({VALUE:"like"},"like")
    ),

//action for listbox changes   
    listSelect: function(event){
        var check=event.target;
        if(check.value=="like"){
            alert("like");
        }
        else{
        alert("equal");
        }
    },

Jan Honza Odvarko

unread,
Oct 3, 2012, 3:13:35 AM10/3/12
to Firebug
I tried the following code in the Domplate runner.
http://softwareishard.com/domplate/runner/

var template = domplate(
{
listbox:
SELECT({onchange:"$listSelect"},
OPTION({VALUE:"equal"},
"equal"
),
OPTION({VALUE:"like"},
"like"
)
),

listSelect: function(event)
{
var check = event.target;

if (check.value=="like")
alert("like");
else
alert("equal");
}
});

// Template execution.
template.listbox.replace({}, parentNode, template);

and when changing the value of the listbox I am seeing an alert
with "equal" or "like" labels.

So, it seems to be working, no?

Honza

madura pradeep

unread,
Oct 3, 2012, 4:41:37 AM10/3/12
to fir...@googlegroups.com
Yes.It should work on firebug.Also i am successfully use that in firebug extensions.But the problem occurred when it is use inside the FIREBUG LITE  not in the firebug.

Jan Honza Odvarko

unread,
Oct 3, 2012, 6:39:45 AM10/3/12
to Firebug
On Oct 3, 10:41 am, madura pradeep <1990dr...@gmail.com> wrote:
> Yes.It should work on firebug.Also i am successfully use that in firebug
> extensions.But the problem occurred when it is use inside the *FIREBUG LITE
> * not in the firebug.
Check differences between domplate.js in Firebug and domplate.js in
Firebug Lite.
There were some fixes and they perhaps didn't make it into Firebug
Lite.

Honza

madura pradeep

unread,
Oct 8, 2012, 8:17:31 AM10/8/12
to fir...@googlegroups.com
I found the solution.
It is not possible use it as event.target.Have to use  "var target = event.currentTarget || event.srcElement;"
this variable can use as event.target in firebug lite

Jan Honza Odvarko

unread,
Oct 8, 2012, 9:29:23 AM10/8/12
to Firebug
On Oct 8, 2:17 pm, madura pradeep <1990dr...@gmail.com> wrote:
> I found the solution.
> It is not possible use it as event.target.Have to use  "var target =
> event.currentTarget || event.srcElement;"
> this variable can use as event.target in firebug lite
Excellent, can you please send a pull request for
https://github.com/firebug/firebug

(or send a patch if it's easier for you)

So, we can fix the problem in domplate even within Firebug.

Thanks!
Honza

madura pradeep

unread,
Oct 12, 2012, 12:21:27 AM10/12/12
to fir...@googlegroups.com
I have try to add a pull request.But i can not find the way add it to firebug.

Jan Honza Odvarko

unread,
Oct 12, 2012, 2:53:43 AM10/12/12
to Firebug

On Oct 12, 6:21 am, madura pradeep <1990dr...@gmail.com> wrote:
> I have try to add a pull request.But i can not find the way add it to
> firebug.
Ah, so could you please create new issue report and just attach your
patch?
(or a description of what you have done in lite?)

Thanks!
Honza
Reply all
Reply to author
Forward
0 new messages