question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow passing editorData (aka dialogData) to editorService.open

See original GitHub issue

The v8 editorService is a great replacement for dialogService, built from scratch to be used all over the backoffice and allowing infinite editing.

There is one feature, though, that seems to have been lost in the trade: the option to pass custom data (formerly ‘dialogData’) to the overlay controller.

Unless there is a way to do this (I didn’t found it) and if you find this feature useful I can gladly submit a PR - it only requires adding one line in umbraco.controller.js:

Before:

// event for infinite editors
evts.push(eventsService.on('appState.editors.open', function (name, args) {
    $scope.infiniteMode = args && args.editors.length > 0 ? true : false;
}));

After:

// event for infinite editors
evts.push(eventsService.on('appState.editors.open', function (name, args) {
    $scope.infiniteMode = args && args.editors.length > 0 ? true : false;
    $scope.editorData = args && args.editor ? args.editor.editorData: null;
}));

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
abjernercommented, May 31, 2019

@JoseMarcenaro the entire object you pass along to the editorService.open method is accessible through the controller via $scope.model.

Eg. with

editorService.open({
    size: "small",
    view: "/App_Plugins/Skybrud.Umbraco.Redirects/Views/Dialogs/Add.html",
    example: { test: true },
    submit: function (value) {
        editorService.close();
    }
});

you’ll be able to call $scope.model.example.test to get my example boolean value.

Isn’t this what you’re looking for, or are you describing something else?

0reactions
John-Blaircommented, Sep 3, 2019

Glad you raised this issue…i was wondering the exact same thing about dialogData.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found