Skip to content

Commit

Permalink
Added Sorting on Deserialize highlights
Browse files Browse the repository at this point in the history
Serialize has highlights sorting but Deserialize, added it.
  • Loading branch information
Cavva79 committed Feb 2, 2016
1 parent 23ca5e3 commit 265dda9
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/rangy-classapplier.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Copyright 2016, Tim Down
* Licensed under the MIT license.
* Version: 1.3.1-dev
* Build date: 15 January 2016
* Build date: 2 February 2016
*/
(function(factory, root) {
if (typeof define == "function" && define.amd) {
Expand Down
2 changes: 1 addition & 1 deletion lib/rangy-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright 2016, Tim Down
* Licensed under the MIT license.
* Version: 1.3.1-dev
* Build date: 15 January 2016
* Build date: 2 February 2016
*/

(function(factory, root) {
Expand Down
3 changes: 2 additions & 1 deletion lib/rangy-highlighter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Copyright 2016, Tim Down
* Licensed under the MIT license.
* Version: 1.3.1-dev
* Build date: 15 January 2016
* Build date: 2 February 2016
*/
(function(factory, root) {
if (typeof define == "function" && define.amd) {
Expand Down Expand Up @@ -612,6 +612,7 @@
highlight.apply();
highlights.push(highlight);
}
highlights.sort(compareHighlights);
this.highlights = highlights;
}
};
Expand Down
2 changes: 1 addition & 1 deletion lib/rangy-selectionsaverestore.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Copyright 2016, Tim Down
* Licensed under the MIT license.
* Version: 1.3.1-dev
* Build date: 15 January 2016
* Build date: 2 February 2016
*/
(function(factory, root) {
if (typeof define == "function" && define.amd) {
Expand Down
2 changes: 1 addition & 1 deletion lib/rangy-serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Copyright 2016, Tim Down
* Licensed under the MIT license.
* Version: 1.3.1-dev
* Build date: 15 January 2016
* Build date: 2 February 2016
*/
(function(factory, root) {
if (typeof define == "function" && define.amd) {
Expand Down
2 changes: 1 addition & 1 deletion lib/rangy-textrange.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* Copyright 2016, Tim Down
* Licensed under the MIT license.
* Version: 1.3.1-dev
* Build date: 15 January 2016
* Build date: 2 February 2016
*/

/**
Expand Down
1 change: 1 addition & 0 deletions src/modules/rangy-highlighter.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ rangy.createModule("Highlighter", ["ClassApplier"], function(api, module) {
highlight.apply();
highlights.push(highlight);
}
highlights.sort(compareHighlights);
this.highlights = highlights;
}
};
Expand Down

0 comments on commit 265dda9

Please sign in to comment.