Browse Source

Add a currentView property to entities

master
Fen Dweller 5 years ago
parent
commit
ed1763e6e2
1 changed files with 13 additions and 3 deletions
  1. +13
    -3
      macrovision.js

+ 13
- 3
macrovision.js View File

@@ -707,6 +707,16 @@ function makeEntity(info, views, sizes) {
)
});

Object.defineProperty(
this,
"currentView",
{
get: function() {
return entity.views[entity.view];
}
}
)

delete this.init;
return this;
}
@@ -1050,10 +1060,10 @@ function configViewOptions(entity, view) {
e.stopPropagation();
})

if (entity.views[view].units[key]) {
select.value = entity.views[view].units[key];
if (entity.currentView.units[key]) {
select.value = entity.currentView.units[key];
} else {
entity.views[view].units[key] = select.value;
entity.currentView.units[key] = select.value;
}

select.setAttribute("oldUnit", select.value);


Loading…
Cancel
Save