5

I would like to select the frame hosting the 'Dashboard.aspx' page using the Tridion Anguilla JS framework.

Chrome detects 3 frames (with the last being the dashboard) and Firefox detects 2 frames.

Is it possible to refer to the dashboard frame other than the position in the frames array?

Chrome:

var dashChrome = window.top.frames[2]

Firefox:

var dashFF = window.top.frames[1]

1 Answer 1

6

I might be wrong, but assuming you are working on Bookmarklet challenge :) here you go: you can use View Id identifier, which is a $display.getView().getId() == "DashboardView"

And here is the bookmarklet:

javascript: (function (UI, B, e, a, r, d)
{
    try
    {
        while (r = UI.frames[e++])
        {
            if ((a = r.$display && r.$display.getView()) && a.getId() == B)
            {
                d = a;
                break;
            }
        }

        console.log(d);
    }
    catch (x) {};
})(window.top, 'DashboardView', 0)
2
  • You're absolutely correct, I'm taking a stab at the bookmarklet challenge. Thanks to your code my solution is a lot less hackish than before :)
    – robrtc
    Commented Dec 18, 2014 at 13:10
  • 3
    Nice arguments :D Commented Dec 18, 2014 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.