Removing duplicate focusing code.
This commit is contained in:
parent
10e2742ec5
commit
4e4a8ecd20
|
@ -277,6 +277,7 @@ Editor.prototype.set_iframe_contents = function ( contents_text ) {
|
|||
padding = '0.4em 1.5em 1em 1.5em';
|
||||
|
||||
// TODO: maybe just replace the document body if the <head> is already set up?
|
||||
// doing so might mean that we don't have to re-turn on design mode
|
||||
this.document.write(
|
||||
'<html><head><style>html { padding: 0em; margin: 0; } body { padding: ' + padding + '; margin: 0; font-size: 90%; line-height: 140%; font-family: sans-serif; } h3 { padding-bottom: 0.25em; border-bottom: 1px solid #dddddd; margin-bottom: 0.75em; } a[target ^= "_new"] { background: url(/static/images/web_icon_tiny.png) right center no-repeat; padding-right: 13px; } .diff a[target ^= "_new"] { background-image: none; padding-right: 0; } a:hover { color: #ff6600; } img { border-width: 0; } .left_justified { float: left; margin: 0.5em 1.5em 0.5em 0; } .center_justified { display: block; margin: 0.5em auto 0.5em auto; text-align: center; } .right_justified { float: right; margin: 0.5em 0 0.5em 1.5em; } hr { border: 0; color: #000000; background-color: #000000; height: 1px; } ul { list-style-type: disc; } ul li { margin-top: 0.5em; } ol li { margin-top: 0.5em; } .center_text { text-align: center; } .small_text { padding-top: 0.5em; font-size: 90%; } .indented { margin-left: 1em; } .thumbnail_left { float: left; margin: 0.5em; margin-right: 1em; margin-bottom: 0.5em; border: 1px solid #999999; } .thumbnail_right { float: right; margin: 0.5em; margin-left: 1em; margin-bottom: 0.5em; border: 1px solid #999999; }</style>' +
|
||||
'<meta content="text/html; charset=UTF-8" http-equiv="content-type"></meta></head><body>' + contents_text + '</body></html>'
|
||||
|
@ -482,18 +483,6 @@ Editor.prototype.connect_handlers = function () {
|
|||
}
|
||||
|
||||
this.scrape_title();
|
||||
if ( this.init_focus ) {
|
||||
this.init_focus = false;
|
||||
if ( this.iframe )
|
||||
this.focus();
|
||||
|
||||
// special-case: focus any username field found within this div
|
||||
if ( this.div ) {
|
||||
var username = getElement( "username" );
|
||||
if ( username && isChildNode( username, this.div ) )
|
||||
username.focus();
|
||||
}
|
||||
}
|
||||
|
||||
signal( self, "init_complete" );
|
||||
}
|
||||
|
|
Reference in New Issue