Test fixes.

This commit is contained in:
Ivan Vorontsov 2016-05-01 22:26:10 +03:00
parent 619b43ffa4
commit 12b2ee9356

View file

@ -134,12 +134,12 @@
};
Diff2HtmlUI.prototype._initSelection = function() {
var body = $('body'),
that = this;
var body = $('body');
var that = this;
body.on('mousedown', '.d2h-diff-table', function(event) {
var target = $(event.target),
table = target.closest('.d2h-diff-table');
var target = $(event.target);
var table = target.closest('.d2h-diff-table');
if (target.closest('.d2h-code-line,.d2h-code-side-line').length) {
table.removeClass('selecting-left');
@ -162,13 +162,12 @@
Diff2HtmlUI.prototype._getSelectedText = function() {
var table = $('.d2h-diff-table'),
sel = window.getSelection(),
range = sel.getRangeAt(0),
doc = range.cloneContents(),
nodes = doc.querySelectorAll('tr'),
text = '';
var table = $('.d2h-diff-table');
var sel = window.getSelection();
var range = sel.getRangeAt(0);
var doc = range.cloneContents();
var nodes = doc.querySelectorAll('tr');
var text = '';
var idx = currentSelectionColumnId;
if (nodes.length === 0) {