Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lars Heesakkers 38 posts 194 karma points
    Mar 12, 2019 @ 11:45
    Lars Heesakkers
    1

    Media picker dialog closes multiple dialogs

    Hi,

    I have created a grid editor with settings. In this settings, I am trying to open a mediaPicker with editorService.mediaPicker in the angular controller. When I'm done with the image I close the mediapicker with editorService.close(). The problem here is that it closes the mediapicker dialog and the row-settings dialog both instead of the last one.

    here is a gif of what happens:

    enter image description here

    I open the mediaPicker like this:

    $scope.addImage = function () {
                editorService.mediaPicker({
                    onlyImages: true,
                    multiPicker: false,
                    submit: function (item) {
                        $scope.value = {
                            id: item.id,
                            icon: item.icon,
                            name: item.name,
                            image: item.image,
                            alt: getValueOf(item.selection[0].properties, "Alt"),
                            zoomable: $scope.value.zoomable
                        };
                        editorService.close();
                    },
                    close: function () {
                        editorService.close();
                    }
                });
            };
    

    The dialog on the row-setting is opened by Umbraco.

    It seems to me that the mediaPicker dialog replaces the dialog for row-settings in the grid. I could not find any documentation about this. Is someone experiencing the same issues?

    edit: it looks like the click you see in the gif when the media picker is opened and everything has a blur, is causing the unerlaying dialog to close when I click the blur away.

    edit2: When you open another dialog, Umbraco renders a second div with class "umb-overlay-backdrop". This overlay renders in front of the media picker, which will make it unclickable. I hacked the backdrop to never show, which fixes the issue, but is not the solution.

    .umb-overlay-backdrop { display: none !important; }
    
  • Lars Heesakkers 38 posts 194 karma points
    Mar 25, 2019 @ 15:05
    Lars Heesakkers
    0

    Still broken in 8.0.1. Also added an issue in GitHub, no responses (yet). Any help would be appreciated. https://github.com/umbraco/Umbraco-CMS/issues/4977

  • mcgrph 35 posts 162 karma points
    Jul 19, 2019 @ 20:28
    mcgrph
    0

    I also experience the same issue with two editor services open. The first one is a custom template, which I call with editorService.open(dialogOptions) and the second one (which opens from within the first) is called as editorService.contentPicker(dialogOptions). But the moment I open the second editorService, the first one is beeing closed immediatly ... (Using version 8.1.0)

    UPDATE:

    As I've already commented on the issue page on github, I just made a mistake and accidently passed the function call for editorService.close() into the close property of dialogOptions instead of the arrow function () => editorService.close()

Please Sign in or register to post replies

Write your reply to:

Draft