Compare commits

..

No commits in common. "3f6de30013071f60935194588a9d5331f390f718" and "d10390ab5c9e003aadf1634ed101b2463a83ebe8" have entirely different histories.

4 changed files with 11 additions and 23 deletions

View File

@ -44,11 +44,9 @@
display: block; display: block;
position: relative; position: relative;
/* XXX do we need this???
.code { .code {
display: none; display: none;
} }
*/
/* header */ /* header */
.header { .header {
@ -154,8 +152,7 @@
&>.code { &>.code {
position: absolute; position: absolute;
top: 0; top: 0;
height: 100%; height: calc(2 * var(--item-padding) + 1em);
/*height: calc(2 * var(--item-padding) + 1em);*/
overflow: hidden; overflow: hidden;
resize: none; resize: none;
opacity: 0; opacity: 0;

View File

@ -1487,17 +1487,13 @@ var Outline = {
focused: 'cls', focused: 'cls',
}, },
// XXX UPDATE_CODE_SIZE this is a no-op at this point -- do we need this...
_updateCodeSize: function(code, view){ _updateCodeSize: function(code, view){
// XXX UPDATE_CODE_SIZE
return this
code.style.height = code.style.height =
getComputedStyle( getComputedStyle(
view view
?? code.nextSibling) ?? code.nextSibling)
.height .height
return this }, return this },
/* XXX not used...
_updateViewSize: function(view, code){ _updateViewSize: function(view, code){
view.style.height = view.style.height =
getComputedStyle( getComputedStyle(
@ -1516,7 +1512,6 @@ var Outline = {
return view.offsetHeight > code.offsetHeight ? return view.offsetHeight > code.offsetHeight ?
this._updateCodeSize(code, view) this._updateCodeSize(code, view)
: this._updateViewSize(view, code) }, : this._updateViewSize(view, code) },
//*/
// NOTE: this does not internally handle undo as it would be too // NOTE: this does not internally handle undo as it would be too
// granular... // granular...

View File

@ -54,9 +54,7 @@ HTMLElement.decode = function(str){
//--------------------------------------------------------------------- //---------------------------------------------------------------------
HTMLTextAreaElement.prototype.updateSize = function(){ HTMLTextAreaElement.prototype.updateSize = function(){
// NOTE: this is set to 0px to negate the effects of external/inherited this.style.height = ''
// height settings...
this.style.height = '0px'
this.style.height = this.scrollHeight + 'px' this.style.height = this.scrollHeight + 'px'
return this } return this }
HTMLTextAreaElement.prototype.autoUpdateSize = function(){ HTMLTextAreaElement.prototype.autoUpdateSize = function(){

View File

@ -54,20 +54,19 @@ var setup = function(){
- -
blank lines above and below -- the trailing blank is not initially shown blank lines above and below -- the trailing blank is not initially shown
- _not sure about this yet..._
- ``` - ```
code block -- resized on block edit (`keydown` in edit mode) code block -- resized on block edit (`keydown` in edit mode)
``` ```
- _this seems to be because of a stray `\n` after re-render + `white-space: ...` in the `.view` element..._ - the problem\:
- we need to keep both the `.view` and `.code` elements' height in sync
- Q: should the sizes be equal? which is the master size?
- ways to fix: - ways to fix:
- semi-active (current):
- active mode currently disabled (see: `UPDATE_CODE_SIZE`)
- TEST
- passive (preferred): - passive (preferred):
- REJECT try `display:flex` on `.block` and position one elem over the other... - try `display:flex` on `.block` and position one elem over the other...
- REJECT another way to go is to wrap `.text` stuff in a div and style that... - _...not sure how to deal with `.children` yet_
- active: - another way to go is to place `.text` stuff in a div and style that...
- ... - active (current):
- _need to rework the logic..._
- blank line at end of block is initially not shown - blank line at end of block is initially not shown
- this block contains two lines (empty below) - this block contains two lines (empty below)
@ -103,8 +102,7 @@ var setup = function(){
- _this seams to be a problem only on the initial render -- edit/exit fixes the issue..._ - _this seams to be a problem only on the initial render -- edit/exit fixes the issue..._
- _Q: are we using different code paths for initial render and element render???_ - _Q: are we using different code paths for initial render and element render???_
- DONE BUG: can't move down out of a code block (_directly connected to the above_) - BUG: can't move down out of a code block (_directly connected to the above_)
collapsed:: true
- edit this line, then move down - edit this line, then move down
- ``` - ```
code code