mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-26 00:46:52 +00:00
parent
42660b05a7
commit
327fed30c8
@ -74,6 +74,7 @@ function FramedEngine(options) {
|
|||||||
this.copyStyles();
|
this.copyStyles();
|
||||||
// Add event listeners
|
// Add event listeners
|
||||||
$tw.utils.addEventListeners(this.domNode,[
|
$tw.utils.addEventListeners(this.domNode,[
|
||||||
|
{name: "click",handlerObject: this,handlerMethod: "handleClickEvent"},
|
||||||
{name: "input",handlerObject: this,handlerMethod: "handleInputEvent"},
|
{name: "input",handlerObject: this,handlerMethod: "handleInputEvent"},
|
||||||
{name: "keydown",handlerObject: this.widget,handlerMethod: "handleKeydownEvent"}
|
{name: "keydown",handlerObject: this.widget,handlerMethod: "handleKeydownEvent"}
|
||||||
]);
|
]);
|
||||||
@ -147,6 +148,14 @@ FramedEngine.prototype.focus = function() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Handle a click
|
||||||
|
*/
|
||||||
|
FramedEngine.prototype.handleClickEvent = function(event) {
|
||||||
|
this.fixHeight();
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Handle a dom "input" event which occurs when the text has changed
|
Handle a dom "input" event which occurs when the text has changed
|
||||||
*/
|
*/
|
||||||
|
@ -99,7 +99,7 @@ exports.resizeTextAreaToFit = function(domNode,minHeight) {
|
|||||||
scrollTop = container.scrollTop;
|
scrollTop = container.scrollTop;
|
||||||
// Measure the specified minimum height
|
// Measure the specified minimum height
|
||||||
domNode.style.height = minHeight;
|
domNode.style.height = minHeight;
|
||||||
var measuredHeight = domNode.offsetHeight;
|
var measuredHeight = domNode.offsetHeight || parseInt(minHeight,10);
|
||||||
// Set its height to auto so that it snaps to the correct height
|
// Set its height to auto so that it snaps to the correct height
|
||||||
domNode.style.height = "auto";
|
domNode.style.height = "auto";
|
||||||
// Calculate the revised height
|
// Calculate the revised height
|
||||||
|
Loading…
Reference in New Issue
Block a user