-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit resize notifications #31
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be a typo with isVisible
and _isVisible
cosmoz-tabbable-behavior.html
Outdated
}, | ||
|
||
_onDescendantIronResize(event) { | ||
if (this._notifyingDescendant || !this.isVisible) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be this._isVisible
?
cosmoz-tabbable-behavior.html
Outdated
} | ||
}); | ||
|
||
if (!this.isVisible) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
@plequang Fixed typos. |
Prevent firing resize upwards from a descendent when it is not a tab or cosmoz-tabs is not visible Resize
8d29935
to
a6a4de3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
cosmoz-tabbable-behavior.html
Outdated
return Boolean(this.offsetWidth || this.offsetHeight); | ||
}, | ||
|
||
_onDescendantIronResize(event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redefining _onDescendantIronResize
in tabbable behavior is a bit confusing.
Because, looking at cosmoz-tab
behaviors:
behaviors: [
Cosmoz.TabbableBehavior,
Cosmoz.TabbedBehavior
],
one might think this overridden method will also apply to cosmoz-tab
, which is not the case (because the last behavior takes precedence).
So because tabbable behavior is shared between cosmoz-tabs
and cosmoz-tab
, it would be much clearer if _onDescendantIronResize
was redefined in cosmoz-tabs
.
cosmoz-tabbable-behavior.html
Outdated
} | ||
}); | ||
|
||
if (!this._isVisible) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be also possible to not notify descendants when this._isVisible
is false ?
cosmoz-tabbable-behavior.html
Outdated
return; | ||
} | ||
|
||
if (!Polymer.Settings.useShadow) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If redefining _onDescendantIronResize
, maybe you should consider this PR PolymerElements/iron-resizable-behavior#35
Limit resize notifications to selected tab and check for visible before firing a resize.
fixes #30