mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
Fix bug in applying styles in Opera/IE.
Was removing the crucial empty text node that these browsers use to indicate and editable line.
This commit is contained in:
parent
d24aba73ad
commit
3f5233c61a
6 changed files with 10 additions and 16 deletions
|
@ -64,6 +64,7 @@
|
|||
<span id="removeList">Unlist</span>
|
||||
|
||||
<span id="insertImage" class="prompt">Insert image</span>
|
||||
<span id="setHTML" class="prompt">Set HTML</span>
|
||||
|
||||
<span id="undo">Undo</span>
|
||||
<span id="redo">Redo</span>
|
||||
|
|
|
@ -7,7 +7,7 @@ Unlike other HTML5 rich text editors, squire was written as a component for writ
|
|||
|
||||
### Lightweight ###
|
||||
|
||||
* Only 7KB of JS after minification and gzip (25KB before gzip).
|
||||
* Only 8KB of JS after minification and gzip (26KB before gzip).
|
||||
* Does not include its own XHR wrapper, widget library or lightbox overlays.
|
||||
* No dependencies.
|
||||
* No UI for a toolbar is supplied, allowing you to integrate seamlessly with the
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
<!--[if IE 9]>
|
||||
<script type="text/javascript">window.ie = 9;</script>
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="squire.js"></script>
|
||||
</head>
|
||||
<body></body>
|
||||
<body><script type="text/javascript" src="squire.js"></script></body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,7 @@
|
|||
|
||||
/*global Range, window, document, setTimeout */
|
||||
|
||||
document.addEventListener( 'DOMContentLoaded', function () {
|
||||
( function ( doc ) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -16,13 +16,12 @@ document.addEventListener( 'DOMContentLoaded', function () {
|
|||
FILTER_ACCEPT = 1, // NodeFilter.FILTER_ACCEPT,
|
||||
FILTER_SKIP = 3; // NodeFilter.FILTER_SKIP;
|
||||
|
||||
var doc = document,
|
||||
win = doc.defaultView,
|
||||
var win = doc.defaultView,
|
||||
body = doc.body;
|
||||
|
||||
var isOpera = !!win.opera;
|
||||
var isIE = !!win.ie;
|
||||
var useTextFixer = isOpera || isOpera;
|
||||
var useTextFixer = isIE || isOpera;
|
||||
|
||||
// --- DOM Sugar ---
|
||||
|
||||
|
@ -528,12 +527,8 @@ document.addEventListener( 'DOMContentLoaded', function () {
|
|||
// If not at least partially contained, wrap entire contents
|
||||
// in a clone of the tag we're removing and we're done.
|
||||
if ( !range.containsNode( node, true ) ) {
|
||||
// Tidy up as we go...
|
||||
if ( isText && !node.length ) {
|
||||
node.detach();
|
||||
}
|
||||
// Ignore bookmarks
|
||||
else if ( node.nodeName !== 'INPUT' ) {
|
||||
if ( node.nodeName !== 'INPUT' ) {
|
||||
toWrap.push([ exemplar, node ]);
|
||||
}
|
||||
return;
|
||||
|
@ -1585,4 +1580,4 @@ document.addEventListener( 'DOMContentLoaded', function () {
|
|||
body.setAttribute( 'contenteditable', 'true' );
|
||||
win.editor.setHTML( '' );
|
||||
|
||||
}, false );
|
||||
}( document ) );
|
|
@ -51,7 +51,6 @@
|
|||
<!--[if IE 9]>
|
||||
<script type="text/javascript">window.ie = 9;</script>
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="squire.js"></script>
|
||||
</head>
|
||||
<body></body>
|
||||
<body><script type="text/javascript" src="squire.js"></script></body>
|
||||
</html>
|
Loading…
Reference in a new issue