Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

Popup when called as secondaryAction are not working properly. #553

Closed
timota opened this issue Nov 29, 2020 · 2 comments · Fixed by #555
Closed

Popup when called as secondaryAction are not working properly. #553

timota opened this issue Nov 29, 2020 · 2 comments · Fixed by #555

Comments

@timota
Copy link
Contributor

timota commented Nov 29, 2020

Actions for tiles that defined inside popup that called as secondaryAction - are not working.

When i’ve redefined secondaryAction for tile and call this.$scope.openPopup - tiles inside popup not clickable(action - doesn't work), but if you add lights with (+/-) - actions for those buttons work.

Sample code:

{
    type: TYPES.SWITCH,
    subtitle: 'Kitchen',
    position: [1, 3],
    id: 'light.f1_r1_light_base_fan',
    title: 'Test',
    icons: {
       on: 'mdi-spin mdi-fan',
       off: 'mdi-fan',
    },
    states: {
       on: "On",
       off: "Off"
    },
    secondaryAction: function (item, entity) {
       this.$scope.openPopup({
          type: TYPES.POPUP,
          position: [0, 3],
          id: {},
          icon: 'mdi-android',
          title: 'History popup',
          state: false,
          popup: {
             tileSize: 100,
             items: [
                {
                   type: TYPES.SWITCH,
                   subtitle: 'Kitchen1',
                   position: [1, 3],
                   id: 'light.f1_r1_light_base_fan',
                   title: 'Test',
                   icons: {
                      on: 'mdi-spin mdi-fan',
                      off: 'mdi-fan',
                   },
                   states: {
                      on: "On",
                      off: "Off"
                   },
                },
             ]
          }
       }, '');
    },
 }

but if you add action to second tile Kitchen1 - it works as expected.

action: function (item, entity) {
    console.log('test');
},

looks like #551 not fixed issue completely.

@rchl can you please check

rchl added a commit that referenced this issue Nov 29, 2020
We've overlooked the fact that user can pass a newly created tile object
to $scope.showPopup() in which case the tile defaults were not merged.

Explicitly merge defaults from the showPopup() call but avoid doing it
multiple times for tiles that have already had defaults merged by
checking a special cache key.

Fixes #553
@rchl
Copy link
Collaborator

rchl commented Nov 29, 2020

Fixing in #555

resoai pushed a commit that referenced this issue Nov 29, 2020
#555)

We've overlooked the fact that user can pass a newly created tile object
to $scope.showPopup() in which case the tile defaults were not merged.

Explicitly merge defaults from the showPopup() call but avoid doing it
multiple times for tiles that have already had defaults merged by
checking a special cache key.

Fixes #553
@timota
Copy link
Contributor Author

timota commented Nov 29, 2020

Thanks, Will try

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants