witten
/
luminotes
Archived
1
0
Fork 0

Resizing browser text now causes wiki notes to resize accordingly.

This commit is contained in:
Dan Helfman 2008-03-11 23:50:09 +00:00
parent 493a265a52
commit 22228f5a2c
2 changed files with 18 additions and 0 deletions

3
NEWS
View File

@ -1,3 +1,6 @@
1.2.12: March 11, 2008
* Resizing browser text now causes wiki notes to resize accordingly.
1.2.11: March 11, 2008
* Added a Debian init script to run the Luminotes server from
/etc/init.d/luminotes.

View File

@ -15,6 +15,7 @@ function Wiki( invoker ) {
this.invites = evalJSON( getElement( "invites" ).value );
this.invite_id = getElement( "invite_id" ).value;
this.after_login = getElement( "after_login" ).value;
this.font_size = null;
var total_notes_count_node = getElement( "total_notes_count" );
if ( total_notes_count_node )
@ -61,6 +62,7 @@ function Wiki( invoker ) {
connect( "html", "onclick", this, "background_clicked" );
connect( "html", "onkeydown", this, "key_pressed" );
connect( window, "onresize", this, "resize_editors" );
connect( document, "onmouseover", this, "detect_font_resize" );
var blank_note_stub = getElement( "blank_note_stub" );
if ( blank_note_stub ) {
@ -698,6 +700,19 @@ Wiki.prototype.resize_editors = function () {
}
}
Wiki.prototype.detect_font_resize = function () {
if ( !window.getComputedStyle ) return;
var style = window.getComputedStyle( getElement( "content" ), null );
if ( !style ) return;
if ( style.fontSize == this.font_size )
return;
this.font_size = style.fontSize;
this.resize_editors();
}
Wiki.prototype.editor_state_changed = function ( editor, link_clicked ) {
this.update_toolbar();