Fix selectors for file list elements
When the checkbox was moved to where the favourite icon was shown before the layout of the file list was modified. The first column is no longer the file name, so neither the thumbnail nor the name link were found. Due to this the thumbnail was not set to the appropriate icon, and the dummy event handler was not removed from the name link, so clicks on the name were basically ignored. Now the selectors are based on the ".filename" CSS class instead of relying on the column position. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
e37fa60784
commit
78891ac320
|
@ -489,7 +489,7 @@ OCA.External.StatusManager.Utils = {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var icon = trFolder.find('td:first-child div.thumbnail');
|
var icon = trFolder.find('td.filename div.thumbnail');
|
||||||
icon.each(function () {
|
icon.each(function () {
|
||||||
var thisElement = $(this);
|
var thisElement = $(this);
|
||||||
if (thisElement.data('oldImage') === undefined) {
|
if (thisElement.data('oldImage') === undefined) {
|
||||||
|
@ -510,7 +510,7 @@ OCA.External.StatusManager.Utils = {
|
||||||
trFolder = $('#fileList tr[data-file=\"' + OCA.External.StatusManager.Utils.jqSelEscape(folder) + '\"]');
|
trFolder = $('#fileList tr[data-file=\"' + OCA.External.StatusManager.Utils.jqSelEscape(folder) + '\"]');
|
||||||
}
|
}
|
||||||
trFolder.removeClass('externalErroredRow').removeClass('externalDisabledRow');
|
trFolder.removeClass('externalErroredRow').removeClass('externalDisabledRow');
|
||||||
var tdChilds = trFolder.find("td:first-child div.thumbnail");
|
var tdChilds = trFolder.find("td.filename div.thumbnail");
|
||||||
tdChilds.each(function () {
|
tdChilds.each(function () {
|
||||||
var thisElement = $(this);
|
var thisElement = $(this);
|
||||||
thisElement.css('background-image', thisElement.data('oldImage'));
|
thisElement.css('background-image', thisElement.data('oldImage'));
|
||||||
|
@ -529,10 +529,10 @@ OCA.External.StatusManager.Utils = {
|
||||||
$.each(filename, function (index) {
|
$.each(filename, function (index) {
|
||||||
route = OCA.External.StatusManager.Utils.getIconRoute($(this));
|
route = OCA.External.StatusManager.Utils.getIconRoute($(this));
|
||||||
$(this).attr("data-icon", route);
|
$(this).attr("data-icon", route);
|
||||||
$(this).find('td:first-child div.thumbnail').css('background-image', "url(" + route + ")").css('display', 'none').css('display', 'inline');
|
$(this).find('td.filename div.thumbnail').css('background-image', "url(" + route + ")").css('display', 'none').css('display', 'inline');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
file = $("#fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td:first-child div.thumbnail");
|
file = $("#fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td.filename div.thumbnail");
|
||||||
var parentTr = file.parents('tr:first');
|
var parentTr = file.parents('tr:first');
|
||||||
route = OCA.External.StatusManager.Utils.getIconRoute(parentTr);
|
route = OCA.External.StatusManager.Utils.getIconRoute(parentTr);
|
||||||
parentTr.attr("data-icon", route);
|
parentTr.attr("data-icon", route);
|
||||||
|
@ -573,7 +573,7 @@ OCA.External.StatusManager.Utils = {
|
||||||
if (filename instanceof $) {
|
if (filename instanceof $) {
|
||||||
link = filename;
|
link = filename;
|
||||||
} else {
|
} else {
|
||||||
link = $("#fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td:first-child a.name");
|
link = $("#fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td.filename a.name");
|
||||||
}
|
}
|
||||||
if (active) {
|
if (active) {
|
||||||
link.off('click.connectivity');
|
link.off('click.connectivity');
|
||||||
|
|
Loading…
Reference in New Issue