Jump to content

How to show my dialog when press menu in the more commands button?


Recommended Posts

Posted (edited)
Hello.
I am going to add a item in the menu of more commands button.
And when press this item, wanna to show a dialog.

I add a item in a menu of more commands button.
This is my code.
 
itemcontextmenu.js
 
function getCommands(options) {
...
        }), itemHelper.supportsAddingToPlaylist(item) && commands.push({
            name: globalize.translate("sharedcomponents#AdPlay"),
            id: "adplay"
..
}
 
This is my code to show a dialog when press this item.
function executeCommand(item, id, options) {
        var itemId = item.Id,
            serverId = item.ServerId,
            apiClient = connectionManager.getApiClient(serverId);
        return new Promise(function (resolve, reject) {
            switch (id) {
            
                case "addtoplaylist":
                    require(["playlistEditor"], function (playlistEditor) {
                        (new playlistEditor).show({
                            items: [itemId],
                            serverId: serverId
                        }).then(getResolveFunction(resolve, id, !0), getResolveFunction(resolve, id))
                    });
                    break;
                case "adplay":
                    require(["adplayEditor"], function (adplayEditor) {
                        (new adplayEditor).show({
                            items: [itemId],
                            serverId: serverId
                        }).then(getResolveFunction(resolve, id, !0), getResolveFunction(resolve, id))
                    });
                    break;
...
}
 
 
I created "adplayEditor.js" and copied to "\MediaBrowser.ServerApplication\bin\Debug\dashboard-ui\bower_components\emby-webcomponents".
When I press my item, this error occurs.

alameda.js?v=3.2.70.0:1 Uncaught (in promise) Error: Load failed: adplayEditor: http://localhost:8096/web/adplayEditor.js?v=3.2.70.0
    at HTMLScriptElement.<anonymous> (alameda.js?v=3.2.70.0:1) 

Any help will be appreciated.
Thanks.

Edited by Liuguiming
Posted

Hi, we don't currently have any way to do this.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...