Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Handle editor width resize in InlineWidget #2221

Closed
njx opened this issue Nov 27, 2012 · 4 comments
Closed

Handle editor width resize in InlineWidget #2221

njx opened this issue Nov 27, 2012 · 4 comments

Comments

@njx
Copy link
Contributor

njx commented Nov 27, 2012

Currently, each inline widget needs to manage its own width when the host editor resizes. We should provide reasonable default behavior for this which can be overridden. The default behavior in InlineColorEditor is probably what we want to use.

@peterflynn
Copy link
Member

I wonder... the code in MultiRangeInlineEditor says we can't simply set the width to 100% because the DOM node has padding. But if we used box-sizing: border-box could we make it work? Sure would be a lot simpler than window-resize & document-change listeners...

@njx
Copy link
Contributor Author

njx commented Nov 27, 2012

No, that's not the reason we have to set min-width manually. It's because setting it to 100% sets it to 100% of the scroller's clientWidth, not 100% of the scrollWidth. (Widgets aren't children of the lineSpace in our implementation--they're parented directly into the scroller.)

@njx
Copy link
Contributor Author

njx commented Dec 5, 2012

Adding to sprint 18 since it's related to #2220 which I'm looking at.

njx added a commit that referenced this issue Dec 6, 2012
…get base class.

This addresses #2221 and #2218.
As part of this, cleaned up some issues around how we're doing inheritance:
* For #872, switched to using `Object.create()` to hook up prototypes
  (this avoids subtle bugs when binding event handlers in base classes).
* Made it so all child classes call base class implementation for overridden functions
  (even if the base class impl is empty right now). The one exception is `close()`, which
  is a bit weird right now--will file a separate issue on this.
@peterflynn
Copy link
Member

NJ's changes have landed, so closing.

(Note also the confusion above about why 100% width doesn't work has been clarified in the docs, which are now in InlineWidget).

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

No branches or pull requests

2 participants