@@ -15,7 +15,6 @@ var coords = document.getElementById('coords');
1515var undeleteButton = document . getElementById ( 'undeleteButton' ) ;
1616var statusBar = document . getElementById ( 'statusBar' ) ;
1717var statusBarText = document . getElementById ( 'statusBarText' ) ;
18- var defSize = document . getElementById ( 'defSize' ) ;
1918var localFontDiv = [
2019 document . getElementById ( 'localFontDiv0' ) ,
2120 document . getElementById ( 'localFontDiv1' ) ,
@@ -64,7 +63,8 @@ var uFont = ['', '', '', ''];
6463var delItem = {
6564 text : '' ,
6665 num : '' ,
67- note : '' }
66+ note : '' ,
67+ scroll : 0 }
6868var xElBeg = "<button class='x smallFont moveButtons' onclick='DelLine(this)' id='X" ;
6969var xElEnd = "'>X</button>" ;
7070var renButtonHTML = "<button class='upperRightButton' onclick='RenameThisNote()'>Rename</button>" ;
@@ -85,7 +85,6 @@ var lastScrollPos = 0;
8585var firstCall = true ;
8686var currentNote , dummyVar , bgColor , i , currentX , currentY , oldX , oldY , offsetX , offsetY ;
8787var lastLine , itemToEdit , itemTotal , statusTimer , prevNote ;
88- var done ;
8988
9089
9190// ------- declare functions ----------
@@ -401,18 +400,7 @@ function getLines(thisNote) {
401400function onSubmitted ( tempVar ) {
402401 event . returnValue = false ;
403402 AddNote ( tempVar )
404- }
405-
406- function showX ( self ) {
407- // show X to right of each item, on mouseover
408- thisX = "X" + self . id . slice ( 4 ) ;
409- document . getElementById ( thisX ) . style . visibility = 'visible' ;
410- }
411-
412- function hideX ( self ) {
413- // hide X on mouseout
414- thisX = "X" + self . id . slice ( 4 ) ;
415- document . getElementById ( thisX ) . style . visibility = 'hidden' ;
403+ noteBody . scrollTop = noteBody . scrollHeight ;
416404}
417405
418406function showNewNoteBox ( ) {
@@ -675,7 +663,19 @@ function getTime() {
675663function checkOverflow ( thisLine ) {
676664 // check to see if just-added line causes horizontal scroll
677665 if ( noteBody . scrollWidth >= noteBody . offsetWidth ) {
678- document . getElementById ( thisLine ) . className = document . getElementById ( thisLine ) . className + " overflowClass" ;
666+ // loop through line, if not a group of 10 or more chars w/o a space or hyphen, don't add overflowClass
667+ var strLength = 0 ;
668+ var thisLineText = document . getElementById ( thisLine ) . innerText ;
669+ for ( var aa = 6 ; aa < thisLineText . length ; aa ++ ) {
670+ if ( ( thisLineText . slice ( aa , aa + 1 ) == " " ) || ( thisLineText . slice ( aa , aa + 1 ) == "-" ) ) {
671+ strLength = 0 ;
672+ }
673+ else { strLength ++ ; }
674+ if ( strLength > 19 ) {
675+ document . getElementById ( thisLine ) . className = document . getElementById ( thisLine ) . className + " overflowClass" ;
676+ break ;
677+ }
678+ }
679679 }
680680}
681681
0 commit comments