/* This file is part of a free addon to MediaMonkey. In the absence of another license noted below, this source code is licensed for use and the creation of derivative works under the Ventis Limited Reciprocal License. See: https://www.mediamonkey.com/sw/mmw/5/Ventis_limited_reciprocal_license.txt */


PlaylistHeader.prototype.override({
    _initButtons: function ($super) {
        $super();
        const _this = this;
        // Main window: Undock
        if (isMainWindow) {
            this.btnMenu.controlClass.menuArray.push({
                action: bindAction(window.actions.undockPlaylist, () => _this.parentView.viewNode),
                order: 10,
                grouporder: 0
            });
        }
        // Not main window: Close
        else {
            this.btnMenu.controlClass.menuArray.push({
                action: actions.closeUndockedWindow,
                order: 10,
                grouporder: 0
            });
        }
    }
});
