Browse Source

Beautify parent selection for requiresParent

pull/1710/head
David Polak 8 years ago
parent
commit
68da08ad70
  1. 12
      src/style_manager/view/PropertyView.js

12
src/style_manager/view/PropertyView.js

@ -456,14 +456,10 @@ module.exports = Backbone.View.extend({
// Check if the property is available based on parent's property values // Check if the property is available based on parent's property values
if (requiresParent) { if (requiresParent) {
if ( const parent = selected && selected.parent();
selected && const parentEl = parent && parent.getEl();
selected.view && if (parentEl) {
selected.view.$el && const styles = window.getComputedStyle(parentEl);
selected.view.$el[0] &&
selected.view.$el[0].parentNode
) {
const styles = window.getComputedStyle(selected.view.$el[0].parentNode);
each(requiresParent, (values, property) => { each(requiresParent, (values, property) => {
stylable = stylable =
stylable && styles[property] && includes(values, styles[property]); stylable && styles[property] && includes(values, styles[property]);

Loading…
Cancel
Save