GetmeUK / ContentTools

A JS library for building WYSIWYG editors for HTML content.
http://getcontenttools.com
MIT License
3.95k stars 393 forks source link

Double Click element to open Properties Dialog #523

Open ShalomR opened 5 years ago

ShalomR commented 5 years ago

Similar to https://github.com/GetmeUK/ContentTools/issues/334 but I want to open the Properties Dialog when an image or video is clicked, so I can edit the properties or source. Any suggestions? I have tried a few different things with no luck.

screen shot 2019-02-11 at 5 03 32 pm
ContentEdit.Root.get().bind('mount', function (element) {
    if (element.type() !== 'Video') {
        return;
    }

    // Capture a double-click event against the image element
    element.domElement().addEventListener('dblclick', function (ev) {
        ContentTools.PropertiesDialog(element);
    });
});