Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Upgrade scribe version for Chrome 38 workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Wentz committed Oct 9, 2014
1 parent 66e2e18 commit fd25df4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "onion-editor",
"version": "0.2.33",
"version": "0.2.34",
"homepage": "https://github.com/theonion/editor",
"authors": [
"Mike Wnuk <[email protected]>"
Expand All @@ -26,7 +26,7 @@
"devDependencies": {
"jasmine-jquery": "~2.0.5",
"requirejs": "~2.1.9",
"scribe": "theonion/scribe#9d877148c694b7d7a20fc10dfd57c74b9600c8ce",
"scribe": "theonion/scribe#7e01b688c3f510b76cb05e63b0772132adc9eb0e",
"scribe-plugin-blockquote-command": "0.1.0",
"scribe-plugin-curly-quotes": "0.1.2",
"scribe-plugin-formatter-plain-text-convert-new-lines-to-html": "0.1.1",
Expand Down
17 changes: 8 additions & 9 deletions build/onion-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2758,22 +2758,21 @@ define('plugins/core/events',[
var selection = new scribe.api.Selection();
// In Chrome, the range is not created on or before this event loop.
// It doesn’t matter because this is a fix for Firefox.
// We always want to do this because Chrome >= 38 does create the event
// loop and doesn't leave things alone
if (selection.range) {
selection.placeMarkers();
var isFirefoxBug = scribe.allowsBlockElements() && scribe.getHTML().match(/^<em class="scribe-marker"><\/em>/);
selection.removeMarkers();

if (isFirefoxBug) {
var focusElement = getFirstDeepestChild(scribe.el.firstChild);
var focusElement = getFirstDeepestChild(scribe.el.firstChild);

var range = selection.range;
var range = selection.range;

range.setStart(focusElement, 0);
range.setEnd(focusElement, 0);
range.setStart(focusElement, 0);
range.setEnd(focusElement, 0);

selection.selection.removeAllRanges();
selection.selection.addRange(range);
}
selection.selection.removeAllRanges();
selection.selection.addRange(range);
}

function getFirstDeepestChild(node) {
Expand Down
Loading

0 comments on commit fd25df4

Please sign in to comment.