This is a migrated thread and some comments may be shown as answers.
Key F12 to jump to function not working in some cases
5 Answers 3 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jan-Dirk
Top achievements
Rank 1
Jan-Dirk asked on 17 Feb 2014, 10:36 AM
You have to options on how to define a function:

Option 1:
function fancy_function() {
    // Fancy stuff happening here
}


Option 2:
var fancy_function = function() {
    // Fancy stuff happening here, too.
}

Both are accepted ways of defining a function.

The F12 key (at least in AppBuilder) lets you jump to a function if the cursor is located on a that specific function call. However, if your function is defined as in option 2, this does not work. Since the 2nd option has some advantages over option 1, I am using it a lot. 

Could you please make the F12 key be able to jump to functions that are defined as in option 2?

5 Answers, 1 is accepted

Sort by
0
Zdravko
Telerik team
answered on 19 Feb 2014, 12:48 PM
Hi Jan-Dirk,

Thanks for your feedback.
I tried to reproduce your issue, but without avail.
The navigation is working properly and in case you have both declarations they are both shown.

Can you provide us a sample where this is reproducible or some hints?

I look forward to hearing from you.

Regards,
Zdravko
Telerik
Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
0
Jan-Dirk
Top achievements
Rank 1
answered on 19 Feb 2014, 01:05 PM
Hello Zdravko,

Thank you for getting back to me.

Feel free to check it with my app 'Assets to EAM'. Open up 'app.js' and 'database.js' in the 'js'-folder.

In 'app.js' you will find on line 11 a call to initDatabase. Position the cursor somewhere on the word 'initDatabase' and press the F12-key. In the status bar on the bottom of AppBuilder I now see a message "definitions of 'initDatabase' not found".
0
Jan-Dirk
Top achievements
Rank 1
answered on 19 Feb 2014, 01:09 PM
... continued...

In 'database.js' you will see that I have declared function initDatabase as follows:

initDatabase = function()

Now (feel free to) change it to

function initDatabase()

Go back to 'app.js', position the cursor on the word initDatabase and press the F12-key again. Now you will jump to 'database.js' and the cursor will be on the first line of that function.


0
Zdravko
Telerik team
answered on 24 Feb 2014, 09:11 AM
Hello Jan-Dirk,

Thanks for the provided project.
Thanks to it I was able to find the culprit for this issue. As you can see in your database.js file there is no var keyword in front of the initDatabase declaration. Once you add it the navigation will work as expected.

var initDatabase = function() {}

I hope I've been of assistance.


Regards,
Zdravko
Telerik
Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
0
Jan-Dirk
Top achievements
Rank 1
answered on 24 Feb 2014, 09:28 AM
Ah... I am very sorry about that. Thank you very much for pointing that out, I think I never used a var in front of a declaration like this.
Tags
Report a bug
Asked by
Jan-Dirk
Top achievements
Rank 1
Answers by
Zdravko
Telerik team
Jan-Dirk
Top achievements
Rank 1
Share this question
or