lumapps / lumX

The first responsive front-end framework based on Angular & Google Material Design specifications

Home Page:https://ui.lumapps.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lxDialog - close(object) and cancel

mgraszek opened this issue · comments

Hello.

I would like to ask, how can i achieve basic functionality of dialog which is:
a) close(object) - which is function which close dialog and returns object
b) cancel() - which is function which only shutdown dialog without returning anything

These 2 are base stuff for any dialog for any other framework. Is it possible to achieve it using promise?

An event called 'lx-dialog__close-end' is fired when dialog is closed. Does-it fit to your needs? Otherwise, i don't understand what you want to do? You can check the documentation here: http://ui.lumapps.com/components/dialog and you can find an exemple in the dialog demo controller.

Something similar to function we have in bootstrap.

 modalInstance.result.then(function (selectedItem) {
      $scope.selected = selectedItem;
    }, function () {
      $log.info('Modal dismissed at: ' + new Date());
    });
  };

Using broadcasting event its not best idea, because the only thing you broadcast is dialogId

With the new version,
if u open dialog A which open another dialog B
and if u close dialog B, it will throw an error:
TypeError: Cannot read property 'element' of undefined
at this line:

 function checkDialogHeight(_dialogId)
        {
            var dialog = scopeMap[_dialogId].element;

because it dont support multiple dialog anymore :(
quite a big regression from the previous version design..

According to Google guidelines, in the respect of user experience, you should not open a dialog from another one. Are you sure you could do something like that in the last version? Because the directive is pretty much the same.

actually u can do it in both versions. just that the new version will print errors non stop in the browser log because at every interval it will do the check height of non existing modal.
Sure, i guess i need to rethink my process flow for the CMS that im working on.