src/aria/tools/contextual/ContextualMenu.js
function (templateCtxt, xpos, ypos) {

                // bridge is open -> inspector will handle this as well
                var bridge = aria.tools.ToolsBridge;
                if (bridge && bridge.isOpen) {
                    bridge.$raiseEvent({
                        name : "forwardEvent",
                        event : {
                            name : "ContextualTargetFound",
                            templateCtxt : templateCtxt
                        }
                    });
                }

                if (this._popup) {
                    return;
                }

                var popup = new ariaPopupsPopup();
                this._popup = popup;

                popup.$on({
                    "onAfterClose" : this._afterClose,
                    scope : this
                });

                // create a section on the founded template context
                var section = templateCtxt.createSection({
                    fn : function (out) {
                        var tplWidget = new ariaWidgetsTemplate({
                            defaultTemplate : this._appEnvCfg.template,
                            moduleCtrl : {
                                classpath : this._appEnvCfg.moduleCtrl,
                                initArgs : {
                                    templateCtxt : templateCtxt.$interface("aria.templates.ITemplateCtxt"),
                                    driver : this.$interface("aria.tools.contextual.IContextualMenu")
                                }
                            }
                        }, templateCtxt, "NOLINE");
                        out.registerBehavior(tplWidget);
                        tplWidget.writeMarkup(out);
                    },
                    scope : this
                });

                popup.open({
                    section : section,
                    absolutePosition : {
                        top : ypos,
                        left : xpos
                    },
                    modal : true,
                    maskCssClass : "xDialogMask" /* uses the css class from the AriaSkin */,
                    preferredPositions : [{
                                reference : "bottom left",
                                popup : "top left"
                            }, {
                                reference : "bottom left",
                                popup : "top right"
                            }],
                    offset : {
                        top : 0,
                        left : 0
                    },
                    closeOnMouseClick : true,
                    closeOnMouseScroll : true
                });

                this.targetTemplateCtxt = templateCtxt;

            }
function (templateCtxt, xpos, ypos) {

                // bridge is open -> inspector will handle this as well
                var bridge = aria.tools.ToolsBridge;
                if (bridge && bridge.isOpen) {
                    bridge.$raiseEvent({
                        name : "forwardEvent",
                        event : {
                            name : "ContextualTargetFound",
                            templateCtxt : templateCtxt
                        }
                    });
                }

                if (this._popup) {
                    return;
                }

                var popup = new ariaPopupsPopup();
                this._popup = popup;

                popup.$on({
                    "onAfterClose" : this._afterClose,
                    scope : this
                });

                // create a section on the founded template context
                var section = templateCtxt.createSection({
                    fn : function (out) {
                        var tplWidget = new ariaWidgetsTemplate({
                            defaultTemplate : this._appEnvCfg.template,
                            moduleCtrl : {
                                classpath : this._appEnvCfg.moduleCtrl,
                                initArgs : {
                                    templateCtxt : templateCtxt.$interface("aria.templates.ITemplateCtxt"),
                                    driver : this.$interface("aria.tools.contextual.IContextualMenu")
                                }
                            }
                        }, templateCtxt, "NOLINE");
                        out.registerBehavior(tplWidget);
                        tplWidget.writeMarkup(out);
                    },
                    scope : this
                });

                popup.open({
                    section : section,
                    absolutePosition : {
                        top : ypos,
                        left : xpos
                    },
                    modal : true,
                    maskCssClass : "xDialogMask" /* uses the css class from the AriaSkin */,
                    preferredPositions : [{
                                reference : "bottom left",
                                popup : "top left"
                            }, {
                                reference : "bottom left",
                                popup : "top right"
                            }],
                    offset : {
                        top : 0,
                        left : 0
                    },
                    closeOnMouseClick : true,
                    closeOnMouseScroll : true
                });

                this.targetTemplateCtxt = templateCtxt;

            }
function ( templateCtxt , xpos , ypos ) { // bridge is open -> inspector will handle this as well var bridge = aria . tools . ToolsBridge ; if ( bridge && bridge . isOpen ) { bridge . $raiseEvent ( { name : "forwardEvent" , event : { name : "ContextualTargetFound" , templateCtxt : templateCtxt } } ) ; } if ( this . _popup ) { return ; } var popup = new ariaPopupsPopup ( ) ; this . _popup = popup ; popup . $on ( { "onAfterClose" : this . _afterClose , scope : this } ) ; // create a section on the founded template context var section = templateCtxt . createSection ( { fn : function ( out ) { var tplWidget = new ariaWidgetsTemplate ( { defaultTemplate : this . _appEnvCfg . template , moduleCtrl : { classpath : this . _appEnvCfg . moduleCtrl , initArgs : { templateCtxt : templateCtxt . $interface ( "aria.templates.ITemplateCtxt" ) , driver : this . $interface ( "aria.tools.contextual.IContextualMenu" ) } } } , templateCtxt , "NOLINE" ) ; out . registerBehavior ( tplWidget ) ; tplWidget . writeMarkup ( out ) ; } , scope : this } ) ; popup . open ( { section : section , absolutePosition : { top : ypos , left : xpos } , modal : true , maskCssClass : "xDialogMask" /* uses the css class from the AriaSkin */ , preferredPositions : [ { reference : "bottom left" , popup : "top left" } , { reference : "bottom left" , popup : "top right" } ] , offset : { top : 0 , left : 0 } , closeOnMouseClick : true , closeOnMouseScroll : true } ) ; this . targetTemplateCtxt = templateCtxt ; }
Handle what to do when a target for inspection if retrieve
@protected
@param {aria.templates.TemplateCtxt} templateCtxt
@param {Number} xpos
@param {Number} ypos
Handle what to do when a target for inspection if retrieve